Last problem to solve, null pointer exception with new ArrayList

I'm getting a NullPointerException when I run this program. The constructor points List<Meat> meats to new ArrayList(10) when the program is created. But When it tries to add objects to meats gets a nullpointerexception, why?

public Pantry(){

List<Garnish> garnishes=new ArrayList(10);

List<Sauce> sauces=new ArrayList(10);

List<Meat> meats=new ArrayList(10);

orderFood(Meat.class, 10);

orderFood(Garnish.class, 10);

orderFood(Sauce.class, 10);

}

publicvoid orderFood(Class foodType,int numItems){

for(int i= 0; i <= numItems; i++){

try{

addFood((Food) foodType.newInstance());}

catch( InstantiationException exception){

System.out.println(exception);}

catch(IllegalAccessException exception){

System.out.println(exception);

}

}

}

publicstaticvoid main(String[] args){

Pantry p =new Pantry();

p.displayContents();

System.out.println("What kind of Food would you like?");

String choice = KeyboardReader.readLine();

try{

Food order= p.getFood(Class.forName(choice));

if(order ==null){

System.out.println("Sorry, out of that type of food");

p.orderFood(Class.forName(choice), 10);

}

else{

System.out.println("Your order total is "+ order.getPriceToCharge());

}}

catch(ClassNotFoundException exception){

System.out.println(exception);

}

}

}

[2874 byte] By [Red_Jestera] at [2007-10-3 9:21:56]
# 1
nevermind I'm retarded, I was making a new variable, instead of using the one I'd already created.
Red_Jestera at 2007-7-15 4:35:31 > top of Java-index,Java Essentials,New To Java...