Datatype in any programming language specifies the type of variable.
for example, if we define a variable
String a = "CuriousBaba";
Here String is a datatype. So, String specifies that a string of characters can only be stored in the variable.
There are two types of datatype in Java
1. Primitive Datatype
2. Non-primitive Datatype
Primitive datatype include byte, short, float, int, long, boolean, char, double.
Non-primitive datatype String, Array, Class, Interface.
What is a primitive datatype ?
In a primitive datatype the maximum size of the data to be stored in the varible is predefined.
Primitive datatype is a predefined datatype. A primitive datatype should always have some value in it, it cannot be null.
-min.png)
0 Comments