Class - X
Data Types in Java
In programming languages, data types specify the different sizes and values that can
be stored in the variables. It makes Java a statically and strongly typed language.
There are the following two types of data types in Java.
Primitive Data Types: These data types are predefined by the language and represent
single values. They are the most basic building blocks for data manipulation in Java. It
include boolean, char, byte, short, int, long, float and double. Number of primitive data
types in Java is 8.
Non-Primitive Data Types:
Non-primitive data types in Java, also known as reference types, store references to
objects in memory. They are not predefined and are created by the programmer.
These data types offer more flexibility and can store complex data compared to
primitive types. The non-primitive data types include Classes, Interfaces, String, and
Arrays.
Default Values Of Date types