Post increment increments after the statement Pre increment increments before the statement Example: int i = 1 , j = 1; System.out.println("Post Increment"); while(i++ < 5) { System.out.println(i); } System.out.println("Pre Increment"); while(++j < 5) { System.out.println(j); } Output: Post Increment 2 3 4 5 //The condition check starts from 1 < 5,2 < 5,3 < 5,4 < 5,5 < 5 -- break Pre Increment 2 3 4 //The condition check starts from 2 < 5,3 < 5,4 < 5,5 < 5 -- break | 0 |
By: [email protected] On: Sun Oct 29 18:27:13 IST 2017 0 0 0 | 0 |
Are You Satisfied :0Yes0No |
Post increment increments after the statement Pre increment increments before the statement Example: int i = 1 , j = 1; System.out.println("Post Increment"); while(i++ < 5) { System.out.println(i); } System.out.println("Pre Increment"); while(++j < 5) { System.out.println(j); } Output: Post Increment 2 3 4 5 //The condition check starts from 1 < 5,2 < 5,3 < 5,4 < 5,5 < 5 -- break Pre Increment 2 3 4 //The condition check starts from 2 < 5,3 < 5,4 < 5,5 < 5 -- break | 0 |
By: [email protected] On: Sun Oct 29 18:28:00 IST 2017 0 0 0 | 0 |
Are You Satisfied :0Yes0No |