class C{
static int f1(int i) {
System.out.print(i + ",");
return 0;
}
public static void main (String[] args) {
int i = 0;
i = i++ + f1(i);
System.out.print(i);
}
}
how come the answer is 1,0.
Please explain.
first i is incremented to 1 and call f1(1) and there you print i , which prints 1 , and returns 0 which stores in i of main method by calculating 0 + 0 and you print it in main so the output becomes 1, 0