This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What are the advantages when we do like this?

 
bilal haider
Ranch Hand
Posts: 47
Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Mohamed Sanaulla
Saloon Keeper
Pie
Posts: 3159
33
Google App Engine Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bilal, Welcome to JavaRanch

Please TellTheDetails - And what is that you want to do? Also any exceptions you have with the code?
 
bilal haider
Ranch Hand
Posts: 47
Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A is contating an object of b which is containing a hashset of A.
There is no error or exception ... I just want to know that what are the advantages of this kind of containment?
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's say you have this:


Can you see now what it is used for?
 
bilal haider
Ranch Hand
Posts: 47
Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for the quick response, and moving me one step ahead.
What I understand is that Group class is containing distinct child objects.

But why we are containing group object in child object?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its is so you can see an association from both sides. From the Group instance you know what Child object the Group contains. From the Child object, you know what Group this particular Child object belongs to.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic