Primitive Data Types in Java Programming Language

Data type is nothing but the type of the data. Each Variable in Java must have certain type associated with it which tells us what kind of data a variable can store.

Data Types in Java Programming Language are classified into two main groups – Primitive and Reference Data Types.

A primitive Data Types are :

  1. Data types are predefined by the Java language.
  2. Predefined data types are Reserved keyword so we cannot use them as variable name inside program/application
  3. Primitive values do not share state with other primitive values.
  4. Total Number of Primitive Data Types in Java Programming is 8
  5. All Primitive Data Types have respective Wrapper Classes i.e Integer is wrapper class for primitive type int

Primitive Data Types are –

Primitive Data Types in Java :
booleancharbyteint
shortlongfloatdouble

Classification of Data Types in Java Programming Language

Data Types in Java Programming Language

Data Type and Other Details

TypeContainsDefaultSize
booleantrue or falsefalse1 bit
charUnicode Characteru000016 bits
byteSigned Integer08 bits
shortSigned Integer016 bits
intSigned Integer032 bits
longSigned Integer064 bits
floatFloating Number0.032 bit
doubleFloating Number0.064 bit

No comments

Powered by Blogger.