| Author |
Generics
|
Asha Pathik
Ranch Hand
Joined: Feb 08, 2006
Posts: 143
|
|
Hi, I've written this code. Could anyone tell me what should I write in place of /* Commented part */ so that it compiles and invoke the getName() method on each of the object stored in aList. Thanks
|
SCJP 1.5
|
 |
Keith Lynn
Ranch Hand
Joined: Feb 07, 2005
Posts: 2341
|
|
Notice here that ia is the iterator, it is not an element from the list. If you change the print statement to you should get the results you want. Note also that you have a semicolon where you don't need it in the while loop.
|
 |
Asha Pathik
Ranch Hand
Joined: Feb 08, 2006
Posts: 143
|
|
|
Thanks Keith. Its working now.
|
 |
 |
|
|
subject: Generics
|
|
|