Recently I attended an interview, where I was asked,
What are user-defined data types in Java?
I answered that variables declared using class type are user-defined. But I am not convinced with my answer. I feel class type is Reference data type/Object data type.
As per there are two types:
- Primitive data types [int,float..etc].
- Reference type/Object type[String str, user_defined_Class Obj1..etc]
I did search on this, but couldn't get a proper answer.
Kindly shed some light on this.
User defined data typesmeantype defined by the user, so whatever class you wrote.