0

What is the syntax of a composition in java? Can anyone help me

24th Apr 2020, 3:51 AM
Dipesh
Dipesh - avatar
3 Answers
+ 2
Composition is a type of association, a technique which establishes has-a relationship in classes. class Student { int id; String name; String dept; } You can say Student has-a name or Student has-a department.
24th Apr 2020, 7:19 AM
Avinesh
Avinesh - avatar
+ 1
I don't know what you mean by syntax, here is an example which demonstrates it. https://www.javatpoint.com/q/3489/simple-composition-example-program-in-java
25th Apr 2020, 10:07 AM
Avinesh
Avinesh - avatar
0
OK I understood it's function but what does syntax really mean?
25th Apr 2020, 10:01 AM
Dipesh
Dipesh - avatar