Created
April 2, 2019 17:14
-
-
Save isauravmanitripathi/79472f0aff3212fb7b96f543428f7d65 to your computer and use it in GitHub Desktop.
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
| public class variables { | |
| public static void main(String [] arguments) { | |
| int x, y, z; // x, y, and z are all declared | |
| x = 42; // x is given the value of 42 | |
| y = x++; // y is given x's value which is 42 before it is incremented | |
| // and x is then incremented to 43 | |
| z = ++x; // x is incremented to 44, and z is given x's value | |
| System.out.println("x is: " + x); | |
| System.out.println("y is: " + y); | |
| System.out.println("z is: " + z); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment