180. Primitive Data Types

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 -
  1. byte
  2. short
  3. int
  4. long
  5. float
  6. double 
  7. boolean
  8. 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 -

Non-Primitive data types will be explained in the next post. 

Please comment below to feedback or ask questions.

Non-Primitive Data Types will be explained in the next post.

No comments: