Java's Types: Primitives vs Reference Types

In Java there are essentially two different kinds of types. The primitive type denotes non-nullable types like boolean, byte, sbyte, short, integer, float, and double. The reference type denotes all nullable types, typically known as "objects" which always have "Object" as their explicit or implicit super class, e.g. Integer, Double, YourVeryOwnBusinessObject, BusinessDao, PersonDto, RuntimeException, or Exception.

Actually null is a literal of the "null" type which has no name but can be assigned or cast to any reference type. However it cannot be assigned to primitive types. By default all reference types are initialized with null.

Comments

Popular posts from this blog

Tuning ext4 for performance with emphasis on SSD usage

Java 8: Default Interface Implementations, The Diamond Problem, Multiple Inheritance, and Precedence

Tuning ext3 for performance without losing its data integrity potential