• Post Reply Bookmark Topic Watch Topic
  • New Topic

Circular Classes / Cycling Star - Graph  RSS feed

 
Kepler Nasa
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey all,

is there any way of implementing cyclic / circular classes in Java or Scala?

For Example:


As you can see a Person has Set of Groups, and Groups can have List of Persons, whereas Persons have Groups again.
Person <- Group(s) <- Person <- Group(s) <- ...

How can I put a reference to it in Groups?
 
Les Morgan
Rancher
Posts: 779
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shouldn't be a problem in Java:

Java does not do any encapsulation of the object, you are just working with references.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!