Why class is known as a composite data type? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

Why class is known as a composite data type?

29th May 2020, 6:45 PM
Pranjal Bose
2 Réponses
+ 4
And pls mention the language you are talking about, either in the sentence or in the tags
29th May 2020, 6:56 PM
Namit Jain
Namit Jain - avatar
+ 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.
29th May 2020, 6:58 PM
Avinesh
Avinesh - avatar