786snow
Programmer
- Nov 12, 2006
- 75
I am trying to learn javaservlet. I got this code from an example. I don't understand what is "List" here? Why have the put List when they decalared the method "getBrands()"?
and also when they decalared the array brands? is it a some variable type?
**************
import java.util.*;
public class BeerExpert {
public List getBrands (String Color) {
List brands = new ArrayList();
if (color.equals("ambder"))
{ brands.add("Jack Amber");
brands.add("Red Moose")
}
else
{
brands.add("Jail Pale Ale");
brands.add("Gout Stout");
}
return (brands);
}
}
************************
}
and also when they decalared the array brands? is it a some variable type?
**************
import java.util.*;
public class BeerExpert {
public List getBrands (String Color) {
List brands = new ArrayList();
if (color.equals("ambder"))
{ brands.add("Jack Amber");
brands.add("Red Moose")
}
else
{
brands.add("Jail Pale Ale");
brands.add("Gout Stout");
}
return (brands);
}
}
************************
}