These are the default data types in Java.
Primitive
Datatype | Use-case |
---|---|
byte | 1 byte signed ( to ) |
short | 2 bytes signed ( to ) |
int | 4 bytes signed ( to ) |
long | 8 bytes. ( to ) requires you to postappend ‘l’ after number |
float | 4 bytes |
double | 8 bytes |
boolean | one bit |
char null | 2 bytes |
Non-Primitive(Advanced)
Datatype | Use-Case |
---|---|
Strings | a list of characters |
Arrays | array of elements |
Interface | gui |