Created
May 6, 2016 07:46
-
-
Save josephkandi/c9d29b7ead6ceb7f17714fc0898c96b9 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 LongDemo { | |
public static void main (String[] args) { | |
//Use the long type for storing numbers greater than the int type maximum value | |
//It can store values in the range -9.22337203685478E18 to 9.22337203685478E18 | |
//This is a huge number, use this if you really need to, otherwise use int type | |
//For values within the int type range, you don't need anything special | |
long maximumCharacters = 140; | |
System.out.println("maximumCharacters " + maximumCharacters); | |
//You will need to add the L suffix for any numbers less than or greater the int min or max range | |
long maximumPhotoSize = 9223372036854775808L; | |
System.out.println("maximumCharacters " + maximumPhotoSize); | |
//TODO | |
//Try removing the L at the end of 68719476736 and Re-run again | |
//Change the value of maximumPhotoSize to 9223372036854775808L and Run again | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment