✏️ Explanatory Question
Composite datatype:
A datatype that is made up of multiple values or other datatypes.
Examples in Java:
Array → collection of same type of data.
Class/Objects → bundle of variables + methods.
String → technically an object that holds a sequence of characters.
int[] marks = {90, 85, 70}; // Array = composite datatype
User-defined datatype:
A datatype that is created by the programmer using classes, interfaces, or enums.
Example:
class Student {
String name;
int age;
}
Here, Student is a user-defined datatype.