N
newsnet customer
Hi,
I want to implement as association relationship in Java. I understand the implementation for this kind of relationship is called "containment". However, I can not find the code for this on the internet. From what is explained on the internet, I believe the code would look something like this:
/*A Car 'has a' Wheel relationship*/
public class wheel{
public wheel(){
}
}
public class Car{
Wheel w;
public Car(){
w = new Wheel();
}
}
Is this the basic idea?
by the way, what does containment mean?
ST
I want to implement as association relationship in Java. I understand the implementation for this kind of relationship is called "containment". However, I can not find the code for this on the internet. From what is explained on the internet, I believe the code would look something like this:
/*A Car 'has a' Wheel relationship*/
public class wheel{
public wheel(){
}
}
public class Car{
Wheel w;
public Car(){
w = new Wheel();
}
}
Is this the basic idea?
by the way, what does containment mean?
ST