Types
- Java has 8 primitive types:
byte
|
float
|
short
|
double
|
int
|
char
|
long
|
boolean
|
- Notice that they are all in lower case.
- By default, whole-number constants are int and decimal-number constants are double.
- You can only perform mathematical calculations with primitives (more on that
later).
- Notice that strings are not primitive types.
- A string is a class type (String) - note the capital letter in the name.
- When you need a new data type, you will create a new class.