What is Data Type?
Data types are common in any language (c, java,etc.,).It tells that the type of data in the variable or what type of value is going to be stored .
For example:
Data types are common in any language (c, java,etc.,).It tells that the type of data in the variable or what type of value is going to be stored .
For example:
int number; // it will store only numericals String word; //Store charchtersthere are two types of data types in java 1.
Primitive
2.Non-Primitive
Numeric
2.Non-Numeric
Non-Primitive sub divided into two types 1.Array
2.Interface
3.Class
See Below Image:
Again Integer subdivided into 4 types 1.
byte
2.Int
3.Long
4.Short
.
Primitive Data Types: it is also called a standard data type , intrinsic or built-in data type.the java compiler contains detailed instructions on each legal operations supported by the data type.
there are 8 primitive data types, these classified into four groups.
NOTE: to find the range of numerical data types use the following formula
it is also called derived type , Abstract data type (or) reference type .The derived data type built on the primitive data type.
Example: Class, Interface. the another good example is string datatype .
Java does not have any unsigned types.the sizes of all numeic types are platform independent.