Skip to content

Instantly share code, notes, and snippets.

@konsolas
Created October 30, 2015 21:27
Show Gist options
  • Save konsolas/0edaa89f9033098fe530 to your computer and use it in GitHub Desktop.
Save konsolas/0edaa89f9033098fe530 to your computer and use it in GitHub Desktop.
Data Types
//http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
byte byteMin = -128;
byte byteMax = 127;
short shortMin = -32768;
short shortMax = 32767;
int intMin = -2147483648;
int intMax = 2147483647;
long longMin = -9.223372e+18L;
long longMax = 9.223372e+18L;
float floatMin = 1.4E-45f;
float floatMax = 3.4028235E38f;
//Doubles can have decimal places, e.g. 7.5
double doubleMin = 4.9E-324D;
double doubleMax = 1.7976931348623157E308D;
//A boolean can only be true or false (Or null).
boolean boolean1 = true;
boolean boolean2 = false;
//Characters have to be surrounded in single quotes.
char myChar = 'c';
String myString = "Hello! I am a string!";
@konsolas
Copy link
Author

wtf even RW

@Cousin
Copy link

Cousin commented Oct 30, 2015

i didnt know booleans can be null omg wow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment