0
incremennt operators
int k=5; for(int i=0;i<3;i++) {k=k++; System.out.println(k);} I was executing this code and the output is 5 5 5 why k is not getting incremented ?
1 Answer
0
k=++k
Or just do k++;
int k=5; for(int i=0;i<3;i++) {k=k++; System.out.println(k);} I was executing this code and the output is 5 5 5 why k is not getting incremented ?