aspose file tools
The moose likes Beginning Java and the fly likes problem with model compilation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "problem with model compilation" Watch "problem with model compilation" New topic
Author

problem with model compilation

sree dhar
Greenhorn

Joined: Mar 04, 2007
Posts: 4
this program is taken from Head First servlets and jsp on page #82.

package com.example.model;

import java.util.*;

public class beerexpert{
public List getBrands(String color)
{
List brands=new ArrayList();
if(color.equals("amber"))
{
brands.add("jack amber");
brands.add("redmoose");
}
else
{
brands.add("jail plae ale");
brands.add("piss");
}
return(brands);
}
}


compiling the above programs gives the following errors
beerexpert.java uses unsafe or unchecked operations
recompile with -Xlint:unchecked for details


i am using windows xp.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56224
    
  13

"sreedharreddy sreedharreddy",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56224
    
  13

That's not an error. It's a warning to do with the use (or lack thereof) of Java 1.5 generics.

It's not a servlet issue, so this post has been moved to a more appropriate forum.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: problem with model compilation
 
Similar Threads
compiling this java program
what problem is this???
Package problems
Unchecked Exception( -Xlint)
package help