| Author |
java uses unchecked or unsafe operations
|
Chris Jr
Greenhorn
Joined: Oct 19, 2005
Posts: 15
|
|
I am new to servlets please help with the second servlet version from HF book When I try to compile the BeerExpert.java (code in page 82) class it says Note: src\com\example\model\BeerExpert .java uses unchecked or unsafe operations Note:Recompile with -Xlint Unchecked for details. Not sure What this means.
|
Chrisjr
|
 |
Karen Jirak
Greenhorn
Joined: Sep 13, 2005
Posts: 25
|
|
Hey Chris, What compiler are you using, 5.0? You get those warnings when you use Lists and you don't specify types, because of the new generics in 5.0. It's nothing to worry about... they are most likely just warning you that you are inserting a raw object into a list and it wants you to parameterize it. It's no problem for the running of the application, though.
|
 |
Chris Jr
Greenhorn
Joined: Oct 19, 2005
Posts: 15
|
|
|
Thanks for the reply, Karen.
|
 |
MI Mohammed
Ranch Hand
Joined: Feb 16, 2005
Posts: 146
|
|
Hi Chris, It shows you are using java 5.0. Read the generic topic of the java official tutorial, you will just be fine. All the same, it just a way of ensuring the right thing ends up at the right place. Say a basket of red balls will always contain red balls. For the example, guess it takes string, so you have to ensure that it is a List of Strings.
|
SCJA(Beta) SCJP 1.4 SCWCD 1.4 SCBCD 1.3 SCBCD 5.0 beta <br />The more practice we get, the better we are at the exams and in life in general. Pls join me at My DEN.
|
 |
 |
|
|
subject: java uses unchecked or unsafe operations
|
|
|