Code: Select all
public class TestClass {
public static int m1(int i)
{
return ++i;
}
public static void main(String[] args) {
int k = m1(args.length);
k += 3 + ++k; //1
System.out.println(k);
}
}
So that means that the JVM computes the "++k" first, before computing the rest of the statement? Is there some kind of rule that applies here?k = 1 + 3 + 2; (at this point value of k is 2 because of ++k). But the value of RHS has not yet been assigned to k.
Thank you