– Building blocks of the Java Programming language
– In Java, everything is an Object – except primitives
– Primitives exist because they are more efficient than their Object counterparts, but they are less flexible


Primitive Object Counterpart
int Integer
double Double
float Float
char Character
boolean Boolean

– Primitives declares as instance variables get default values:

Primitive Default Value
int 0
double 0.0d
float 0.0f
char u000
boolean false

– The Primitives' Object Counterparts don't get a default value, they are just null if they aren't assigned a value


Please go through this useful document from Oracle (the owners of Java) and read up on the finer points of Java Primitives, <sarcasm>it's just captivating reading</sarcasm>:


Free Java Roadmap

Discover exactly what you need to learn and where to start in order to become a professional coder.