This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to work with sets?

 
Bob Zoloman
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new to java, and i only have experience using array type data structures. How can I store multiple sets within a set?

Ex: Store the following sets in HashSet1

[2, 25] - set 1
[4, 64, 2, 1] - set 2
[7, 3, 12, 0] - set 3

Each of the above is a unique set, so how can I store them in a hashset and access each set individually, so they printout like the above? Any help is appreciated.
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[2, 25] - set 1
[4, 64, 2, 1] - set 2
[7, 3, 12, 0] - set 3


 
Bob Zoloman
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ty for your help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic