Created
May 5, 2016 17:16
-
-
Save josephkandi/93e2f92482a46c88f41cde2a3297ef7f to your computer and use it in GitHub Desktop.
This file contains 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 IntDemo { | |
public static void main (String[] args) { | |
////The int type stores values in the range -2147483648 to 2147483647 | |
//The Java compiler is optimized to use the int type | |
//Choose int type when you need a number without a decimal place as your default | |
int currentUsersOnline = 2147483647; | |
System.out.println("currentUsersOnline " + currentUsersOnline); | |
//TODO | |
//Try changing the value of currentUsersOnline to 2147483648 | |
//Notice we can't hold it any longer in the int type | |
//This is the case when you will need to use long type | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment