The problem is in ur Elevator Constructor
Here is the corrected code
import java.util.*;
public class Elevator
{
private LinkedList upList;
public Elevator()
{
upList = new LinkedList();
}
public void insertUp (int floor)
{
Integer theFloor;
theFloor = new Integer(floor);
//System.out.println (theFloor);
Integer anotherFloor;
anotherFloor = new Integer(0);
int firstElement;
upList.add((Integer)theFloor);
anotherFloor = (Integer)upList.get(0);
firstElement = anotherFloor.intValue();
}
public int getFirstFloor()
{
Integer ObjectFirstFloor =
(Integer)upList.get(0);
int firstFloor = ObjectFirstFloor.intValue();
return firstFloor;
}