On May 10, 9:19 am, varshini <[email protected]> wrote:
> how to create class objects in hashset ....please help
Just like in any other collections, I use generics here:
// Create a HashSet object
HashSet<Object> hs = new HashSet<Object>();
// Populate it
for (Object elem : myPopulation) {
hs.add(elem);
}
Provided that somewhere in your code you have defined myPopulation as
an array of Object.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---