0
Why class is known as a composite data type?
2 ответов
+ 4
And pls mention the language you are talking about, either in the sentence or in the tags
+ 4
It is because of its composition, it consists of instance and class variables, methods and references to objects of other classes etc.
https://en.wikipedia.org/wiki/Composite_data_type
Also Composition is a technique which implements the HAS - A relationship in classes.
class Employee {
int id;
String department;
}
Employee has-a id.
Employee has-a department.