Last Time
We learned about Java's eight primitive types.
Type | Description |
---|---|
byte | This is a one-byte signed integer |
short | This is a two-byte signed integer |
int | This is a four-byte signed integer |
long | This is a eight-byte signed integer |
float | This is a four-byte IEEE754 floating-point number |
double | This is an eight-byte IEEE754 floating-point number |
boolean | This stores true or
false . |
char | This is a single unicode character |
These types are stored directly by variables on the stack. Note that none is larger than 8 bytes.
Also notice that they are uncapitalized. The existence of these commonly-used types gives Java a performance boost.
Object Types Every other type in Java is an object type. Every class you write creates a new type.
Classes in Java and Python
A class is a blueprint for the creation of objects. When you make a class, you will specify state and behavior. The JVM creates objects from classes and gives them identity.
Collections of classe are organized into packages.
Colllection of packages are organized into modules