1/18
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
char
2 bytes - primitive that stores one character - uses single quotes
boolean
1 bit- primitive that stores either true or false
byte
1 byte- holds 8 bits of memory and stores integer values from -128 to 127
short
2 bytes - holds 16 bits of memory and stores integer values from -32768 to 32767
int
4 bytes - holds 32 bits of memory and stores integer values from -2billion to +2billion
long
8 bytes - holds 64 bits of memory and stores integer values from -10,000000000000000000 to 10,000000000000000000
float
4 bytes- holds 32 bits of memory and stores decimal values with up to 6 or 7 digits
double
8 bytes - holds 64 bits of memory and stores decimal values up to 15-16 decimal places
variable declaration
dataType variableName = value;
constant declaration
final dataType variableName = value;
Casting
(new dataType) value
Object Construction
ClassName objectName = new ClassName(parameters);
Method Call (static)
ClassName.methodName(parameters);
Method Call (Instance)
objectName.methodName(parameters);
Importing a Class
import java.something;
if statement
if (condition)
statement;
else
statement;
if-else-if statement
if (condition)
statement;
else if (condition)
statement;
.
.
.
else
statement;
if else statement
if (condition)
statement;
else if (condition)
statement;
switch statement
switch (expression) {
case value1:
statement;
break;
case value2:
statement;
break;
case value3:
statement;
break;
.
.
.
default:
statement;
break;