What the following code will type:

int i = 0;
System.out.print(++i);
System.out.print(i++);
System.out.print(i);
Explanation
Pre-increment will increase the value of the variable before the use, whereas the post-increment - after.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes