This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Generics 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 "Generics" Watch "Generics" New topic
Author

Generics

Abhi vijay
Ranch Hand

Joined: Sep 16, 2008
Posts: 509
When I try to run generics + legacy code, I get this warning:
Recompile with -Xlint:unchecked for details.

How do i recompile it??
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3418
    
  12
The same way as you compiled it the first time but add -Xlint:unchecked as an extra option.


Joanne
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

The warning doesn't mean you need to recompile it. It's just a hint that if you recompile with these options, you see why this warning is being shown. Since you're using legacy code it's probably something with raw types.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Generics
 
Similar Threads
Class and generics
Generics Questions
generics
having trouble understanding generics
Problem with Generics