Java Programming Language supports 8 primitive data types. Primitive data types are predefined by the Java language and are named by reserved keywords.
Example -
int sum; //int is the primitive data type predefined by Java and is named by a reserved keyword int.
The 8 primitive data types supported Java Programming language are -
- byte
- short
- int
- long
- float
- double
- boolean
- char
Although Java is a object oriented programming language, but the primitive data types are not object oriented.
Why are the primitive data types not object oriented ?
Making the primitive data types into objects would have degraded the performance too much. Hence primitive data types are not object oriented in Java.
Java categories the Primitive data types as shown below -
Java categories the Primitive data types as shown below -
Non-Primitive data types will be explained in the next post.
Please comment below to feedback or ask questions.
No comments:
Post a Comment