7 October 2021

Last Time

We learned about Java's eight primitive types.

TypeDescription
byteThis is a one-byte signed integer
shortThis is a two-byte signed integer
intThis is a four-byte signed integer
longThis is a eight-byte signed integer
floatThis is a four-byte IEEE754 floating-point number
doubleThis is an eight-byte IEEE754 floating-point number
booleanThis stores true or false.
charThis 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.

Java API Documentation

Collections of classe are organized into packages.

Colllection of packages are organized into modules