File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes unchecked warning 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 "unchecked warning " Watch "unchecked warning " New topic
Author

unchecked warning

Changchun Wang
Ranch Hand

Joined: Feb 15, 2006
Posts: 83
Under what circumstances ,the compiler will generate unchecked warning?
I know assign a parameterized type to a raw type and will give warning
but List<? extends Comparale> will occur a warning?
Generally we use List<? extends Comparale<String>> or other
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

I am not sue what you mean by unchecked warning. When you use legacy code like List list = new ArrayList(); and add stuff to this list that might generate warnings. Or when you pass parameterized data to a function that accepts a List list then you might get a warning. When you use generics with collections you will not get warnings. When you mix them with legacy code, watch out.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Changchun Wang
Ranch Hand

Joined: Feb 15, 2006
Posts: 83
There are some questions about some code compiling without no warning and compie error.
so i want to know warning clearly
thanks you replies
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Compile error is when your code does not compile and no .class file is created

Compile with warning is when the compiler tells you that the code that you have written could be risky but it generates a .class file anyway. There are no errors. The warnings are displayed on the console.

Compile without warning is when the compiler is fine with the way you have written the code and generates a .class file. There are no errors and no warnings.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unchecked warning