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


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Generics" Watch "Generics" New topic
Author

Generics

Nikhil Jain
Ranch Hand

Joined: May 15, 2005
Posts: 383


Eclipse gives a warning for the above code.
Type safety: The cast from Object to HashMap<String,Object> is actually checking against the erased type HashMap

How will we return something of object type in generics without getting the warning ...


SCJP 1.4, SCWCD 1.4, SCBCD 1.5
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 682

I'm not sure why, but I believe that you need to replace <String, Object> with <String, ?>
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Generics
 
Similar Threads
generics
Generics
Generics
Generics