Instead of using the putAll() method of TreeHash; I passed the HashMap
object as parameter when creating the TreeHash object and printed out
the TreeHash:
TreeMap treeMap = new TreeMap(map);
System.out.println("My hash map in sorted order" + treeMap);
and it works.
On Oct 17, 4:11 pm, miga <[EMAIL PROTECTED]> wrote:
> On Oct 17, 6:18 am, dzgaga <[EMAIL PROTECTED]> wrote:
>
> >Miga-
> > Fantastic. Thanks. It's much simpler and more elegant.
> >I suppose it's
> > a matter of getting more familiar with the libraries.
>
> It is just a matter to go slowly through the resources url mentioned
> in the
> lesson:http://java.sun.com/developer/onlineTraining/collections/Collection.html
> Then read it all carefully, typing all the examples (vs copying them),
> try some changes (in type of collections and type of objects, mixing
> all together) until you get no more errors, etc.
> I don't remember exactly but I think it took me about one week to only
> scratch the surface.
> The problem is more to understand which collection to use that how to
> use it. That means obviously that one should have in a part of one's
> mind the whole hierarchy and its specialisation. Then it is rewarding.
> Thereafter jumping directly into the doc will save you a lot of times.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---