Class design in Java
I have 2 classes in Java with attributes as follows:
public class Student{
String name;
String address;
String course;
Professor advisor; //here i have used a user-defined type
}
public class Professor{
String name;
String address;
String course;
Student advisee; //here i have used a user-defined type
}
I want to make sure as to whether i am using "Composition" as an OOP technique here or not. If not then what is Composition in OOP, please explain clearly in detail with an example.
Thanks
__________________
MAXOOD!
Life is an endless journey towards perfection
|