Here is the explantation of autoboxing: http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html There is a small nuance:
"returns a string object which is cast to an Integer object. " - it returns an Object which is cast to Integer. This code is explained on a referred page. I think that You first add number of contained strings. Based on a result, You add number of nexts strings and ints into a Collection. When the loop finishes, it contains some free strings and one pair. Regards Pacior On 13 Sie, 18:22, JKid314159 <[email protected]> wrote: > Dear Pacior: > > Sorry but this was not a coherent explanation. > > As far as I know there is a key and a value coordinated to it. In our > example we have "1st" as the key and then the name, "Shin" as the value. > > Can I ask you to please clarify your example as I am a beginner and just > learning. Thank. > > Respects, > > > > > JKid314159http://existentialists.blogspot.com/ > > > > > > --- On Wed, 8/12/09, pacior <[email protected]> wrote: > > From: pacior <[email protected]> > Subject: [java programming] Re: Lab1016.3.2 > To: "Free Java Programming Online Training Course By Sang Shin" > <[email protected]> > Date: Wednesday, August 12, 2009, 7:42 PM > > You get an integer object, which is a value of Your Map. > String is always a Key in this example. > > m.get each time returns value. > The smart way of counting numers of strings is dynamically changing > the value of key. > > Regards > Pacior > > On Aug 13, 2:55 am, JKid314159 <[email protected]> wrote: > > > Integer freq = (Integer) m.get(name[i]); > > //m.get(name[i]); returns a string object which is cast to an Integer > > object. > > Not too sure what is going on here. > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
