Data Types
In this lesson, we will discuss primitive data types in Java.
Numeric data types
This classification contains all data types that are numeric.
Did you know?
Variable Types are more often referred to as “Data Types”.
Integer
An integer is a whole number; that is, it does not have any decimal places. Examples of an integer include 4, 5, 2000, whereas numbers that are not integers include 4.3, 4.55.
Within integers, there are different data types that are based on the space they take within memory. The types include short, int, and long.
Note: Data types in Java are all signed. This means that they can store positive as well as negative values of integers.
Floating points
This data type stores numbers that ...