Skip to content

Instantly share code, notes, and snippets.

@briantliao
Last active January 2, 2019 20:48
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 briantliao/677990a38ef1382d557f3bfefc108714 to your computer and use it in GitHub Desktop.
Save briantliao/677990a38ef1382d557f3bfefc108714 to your computer and use it in GitHub Desktop.
// Primitive types:
// int for integer number: -2, -1, 0, 1, 2
int n = 5;
// double for decimal numbers: 2.0, -1.3, .23
double pi = 3.14;
// boolean: true or false values
boolean isHappy = true;
// char for single characters: c, a, q, 1, !, $, \n
char c = 'g';
// Reference types:
// These are objects and can be null
// String for text:
String line = "Hi my name is Jeff.";
// Other objects like arrays, ArrayList, or self created like Dog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment