aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes java uses unchecked or unsafe operations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "java uses unchecked or unsafe operations" Watch "java uses unchecked or unsafe operations" New topic
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java uses unchecked or unsafe operations
 
Similar Threads
Error while compiling
unchecked or unsafe operations
I'm having trouble with running Java
compile warning - what does it mean?
Axis2 - error on client