aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Generics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Generics" Watch "Generics" New topic
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: 2367


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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Generics