About Primitive Data Types In Java
Primitive data types are basic data types supported by Java which can be used to store the information. These data types can be further combined to make more complex (or composite) data types. The following diagram represents the Classification of Primitive data types
Primitive data types are classified into the following groups :
- Booleans help to store true/false like match won/lost, exam passed/failed, male/female etc.,
- Java Characters help to store characters like person names, colors, words etc.,
Depending upon the data which needs to be stored, the corresponding data type should be used. Also note that these data types are further classified depending upon the
size. We need to be cautious in
selecting not only the type but the also appropriate size, in order to
reduce memory wastage. The
sizes and the corresponding
keywords for declaring those types are explained in individual topics.