Non Primitive Data Type in Java
In previous article, we have learned the primitive data types. Now, Let's move one step ahead and learn another kind of data types that is known as non-primitive data types.
Non-primitive data types are not predefined, they are created as per need by the programmers and its size and type is depends on requirements.
Class, Object, String, Array and Interface are the primitive data types and also known as reference type because they refer to the objects. Basically Actually non-primitive variables are references which refers to the heap memory where the object actually stored.

Program to demonstrate the String as non-primitive types.
Output:
Demo@15db9742
Tarique
Program to demonstrate the String Array and Object Array non-primitive types.
Output:
Object Array: Noida
String Array: Delhi
Program to demonstrate the wrapper class like, Integer and Float non-primitive types.
Output:
Integer value : 10
Float value : 25.8
Conclusion
In this article, we learned the non-primitive data types with detailed examples.

Article helpful ?
Switch




