Java collections maps and lists
3. DO -Create a new class called Kangaroo with an int kangarooNumber that’s initialized in the constructor. Give it a very simple method called hop( ) that’s prints out which kangaroo number this is, and that it’s hopping. Create a List and add a group of Kangaroo objects to the List. Now use the get( ) method to move through the List and call hop( ) for each Kangaroo.
4. Modify the above Exercise so you can use an Iterator to move through the List while calling hop()
2. Take the Kangaroo class done in the List exercises and put it in a Map instead, associating the name of the Kangaroo as a String (the key) for each Kangaroo(the value) you put in the table. Get an Iterator for the keySet( ) and use it to move through the Map, looking up the Kangaroo for each key and printing out the key and telling the kangaroo to hop( ). Use generics.
BUt i don't really get it these question as i kind don't understand
Re: Java collections maps and lists
I'm sure you don't expect someone here to do your homework for you or fill in for your instructor. The questions are quite explicit; if you don't understand them at all you need to start with this Tutorial Trail: Learning the Java Language (The Java™ Tutorials)
db