View Single Post
  #1 (permalink)  
Old June 5th, 2009, 08:07 AM
code_lover code_lover is offline
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 46
Thanks: 2
Thanked 1 Time in 1 Post
Lightbulb 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