File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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
 
Similar Threads
Help Me Downcast
Help me fix this-Part-2,so I can compile(generics doubt)
Question for Wildcards in Collection
Generics and ? symbol
Help me fix this,so I can compile(generics doubt)