Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with model compilation

 
sree dhar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65114
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65114
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic