This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Casting generic collections 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 "Casting generic collections" Watch "Casting generic collections" New topic
Author

Casting generic collections

Serch Hdez
Ranch Hand

Joined: May 01, 2008
Posts: 43
Hi, I've been trying to find rules for casting generic collections... is there any links about it?... thanks.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Originally posted by Serch Hdez:
Hi, I've been trying to find rules for casting generic collections... is there any links about it?... thanks.


What do you mean by casting a generic collection ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Serch Hdez
Ranch Hand

Joined: May 01, 2008
Posts: 43
Like


List<Integer>listI = new ArrayList<Integer>();
List<Number> listN = listI;
List<Object> listO = new ArrayList<Object>();
List<String> listS = new ArrayList<String>();
listS = (List<String> listO;
listO = listS;

Something like that, is that even possible?.. thanks.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Casting generic collections
 
jQuery in Action, 3rd edition