I am a bit baffled by the following.
public class
Test {
static int j;
public static void main(
String argv[]){
for(int i =0 ; i<10; i++)
{
j = j++; //xx
System.out.println("i is :" + i);
System.out.println("j is :" + j);
System.out.println();
}
}
}
j gets its own value and the post increment has no effect on it as it does on i. After assigning the value of j to j, shouldnt it then increment j by 1? Changing line marked //xx to read 'j++;' increments j.