Ben Zaidi wrote:Well, i saw the first post. I am wondering why
System.out.print(ga.i + " " + ga.getI())
will first evaluate the getI() method. I am confused, can anyone clarify this doubt please?
Thanks
is evaluated this way:
so to append ga.getI(); first ga.getI() is evaluated completely that prints "Sub", and after that whatever returned by ga.getI() is appended to ga.i value and space value, then converted to
String from StringBuilder than printed.