aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Generics Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply 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: 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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Generics
 
Similar Threads
Help me fix this-Part-2,so I can compile(generics doubt)
Help Me Downcast
Question for Wildcards in Collection
Generics and ? symbol
Help me fix this,so I can compile(generics doubt)