Created
November 18, 2009 08:06
-
-
Save tedheich/237645 to your computer and use it in GitHub Desktop.
Shows the effect of postfix and prefix increment operator in Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IncDec { | |
public static void main(String []args){ | |
int a = 0; | |
int b = 0; | |
int x = a++; | |
int y = ++b; | |
System.out.println("Value of a = " + x); | |
System.out.println("value of b = " + y); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment