+ 5
Java:
DataTypes/
Primitive. Non-Primitive.
int. Arrays
boolean. Strings
float. Self. defined Objects
double. etc...
long
short
bye
char
q)
Is there a way to tell if a data type is non-primitive?
Yea, look at the capitol letters 😜. (is the first letter in caps?)
Constants are variables that cannot change in value once defined. Denoted with the keyword 'final'.
Ex/
final float PI = 3.14;
This is a constant. Now it is impossible to change its value.
Ex/
final float PI = 3.14;
PI = 3.1415; // ERROR
decimals:
double > float
Whole numbers:
long > int > short > byte
True or false:
boolean
Character:
char
Denoted ' '
Ex/
char a = 'a';
Bunch of characters:
String
Denoted " "
Ex/
String word = "hello";