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 ?

10th May 2019, 11:26 AM
Omama Zainab
Omama Zainab - avatar
1 ответ
0
k=++k Or just do k++;
10th May 2019, 11:29 AM
JavaBobbo
JavaBobbo - avatar