permaculture playing cards*
The moose likes Beginning Java and the fly likes unchecked conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "unchecked conversion" Watch "unchecked conversion" New topic
Author

unchecked conversion

amarshi mohanty
Ranch Hand

Joined: Jul 01, 2008
Posts: 110
hi,



is converted to



If there is no generic information (Type Erasure Concept), then why the below warning message is thrown by compiler.Does it mean that internally some kind of mapping about <String> stored?

I will define a generic object and assign it to a non-generic type


Regards,
amarshi


SCJP (97%), SCWCD (95%))
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4338
    
    7

There's no generic information available at run-time...but the compiler isn't running at run time. It runs at compile time (hence the name!). The compiler has full access to all the information in the source code. So the compiler knows you're assigning a non-generic reference to a generic one, and it knows that isn't safe.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unchecked conversion
 
Similar Threads
generic confusion
Type Casting Generics
Trouble assigning enum keys to EnumMap in Java 5.0
How do you create an array of typesafe-collections?
HashMap bean with generic type parameters