Touchstone57
03-04-2009, 08:58 PM
Probably a stupid question, but how do I return the elements of a set? I can seem to find no methods available for doing this...
Say for example I wanted to print out the name of an element in my set, returning an element at the specified index, how would I do it, a long these lines?
Set<SomethingHere> setName = new HashSet<SomethingHere>(ListHere);
//Though the get operation was not available
System.out.println(setName.get(1).getName());
Any help greatly appreciated, thanks.
Say for example I wanted to print out the name of an element in my set, returning an element at the specified index, how would I do it, a long these lines?
Set<SomethingHere> setName = new HashSet<SomethingHere>(ListHere);
//Though the get operation was not available
System.out.println(setName.get(1).getName());
Any help greatly appreciated, thanks.