• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

relationship between classes

 
ramya ray
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
Please guide me about the confusion of relationship between classes
question from sun epractice exam ..
class A {
class B{
private A m = new A();
}
}
options:
1. class A maintains no relation with B

2. class b maintain relation with A.
MY QUESTION IS : Does here it is talking about inner class relation or class B has A ?

3. Is B maintain one to many relationship with A
Please describe what it mean ?
4 The relation can be described as Has-A clause.
is it talking about class b has A .
Answer is : 2 & 4 are correct statements.

If a class implements inteface so does it "IS- A" relation.
what is relation between inner class and outer class other than you can not instantiate it withut outer class instance.
 
deepak adlakha
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check this out..

http://www.javaranch.com/campfire/StoryInner.jsp

Hope this helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic