hi, On Mar 12, 7:26 pm, Tanya Dina Ruttenberg <[email protected]> wrote: > What is the difference between declaring a HashMap (for example) like this: > Map m = new HashMap(); here m is a more generic one. It can have hashMap, TreeMap etc., ie., we can assign an object of all these type to m. And I think this prefers over using HashMap m;
> versus > HashMap m = new HashMap(); > ? here, we can't assign a TreeMap later to m. > Obviously this question is not specific to Collections. > Tanya --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
