aspose file tools*
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Casting generic collections