Understanding Java’s primitive data types
Java provides eight in-built data types. In-built means that these data types come with the language. These primitive data types are the topic of this section.
Java’s primitive data types
All of the primitive data types are named using lowercase letters only; for example, int
and double
. When we create our own data types later on, namely classes, records, and interfaces, we will follow a different naming convention. For example, we may have a class named Person
or Cat
. This is simply a widely adopted coding convention and the compiler does not distinguish between naming conventions. However, it is very easy to recognize any of the primitive data types as they are always in lowercase letters only. Before we discuss the primitive data types themselves, there are a few important points to make.
Numeric primitive data types are signed
In Java, all numeric primitive data types are represented as a series of bits. In addition...