Code:
public class Sample
{
public int called()
{
System.out.println(".....I shouldn't be here.....");
return 0;
}
public void caller()
{
System.out.println("It is supposed to be here -->(" + called() + ")<-- Why isn't it working?\n");
}
}
public class Test
{
public static void main(String args[])
{
Sample me = new Sample();
me.caller();
}
}
.....I shouldn't be here.....
It is supposed to be here -->(0)<-- Why isn't it working?
so why is it like this? is this an error or a bug or is it intended? if it was intended, explane how please..
Comment