Data type : It defines the type of data or the data is of which type.
Data type is of two types or we can also say variables are of two type .
- Primitive data type .
- non Primitive data type .
Non primitive data type : Size of the data is not fixed . In non primitive since size of the data is not fixed . String and Array are the non primitive data type .
example : int marks[5] ={ 1 , 2 ,3 ,4 , 6} ;
If we write using new keyword : int [ ] marks =new int [5];
In both the examples we make an array of size 5 . we can make any size . so it is not fixed . Therefore it is known as non primitive data type . Data type in C and Data types in java both are two types.
Tags:
data structure