Skip to content

Instantly share code, notes, and snippets.

@josephkandi
Created May 6, 2016 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephkandi/c9d29b7ead6ceb7f17714fc0898c96b9 to your computer and use it in GitHub Desktop.
Save josephkandi/c9d29b7ead6ceb7f17714fc0898c96b9 to your computer and use it in GitHub Desktop.
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