Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unchecked warning

 
Changchun Wang
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Changchun Wang
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic