I am currently using eclipse for the project but im doing all the examples from the book at command prompt and this is where im having trouble... the BeerSelect and BeerExpert programs don't compile at all...
i have 2 programs[as given in the book] one BeerExpert.java which is in the folder
c:\java\xyz\beerv1\src\com\example\model\BeerExpert.java
In the BeerExpert.java I have included it into a package as
package com.example.model;
the other BeerSelect.java which is at
c:\java\xyz\beerv1\src\com\example\web\BeerSelect.java
and in the file BeerSelect.java Im importing it as
import com.example.model.*;
And im compiling at my cmd prompt as
c:\java\xyz\beerv1> javac -classpath programfiles/apachesoftwarefoundation/tomcat5.5/common/lib/servlet-api.jar:classes: -d classes src/com/example/model/BeerExpert.java
And the warning im getting is
Note: src/com/example/model/BeerExpert.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
This is the code from the book.[for BeerExpert.java]
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("Red Moose");
}
else {
brands.add("Jail Pale Ale");
brands.add("Gout Stout");
}
return(brands);
}
}
Could you please tell where Im going wrong here..?