1

Can't initialise ArrayList

view story
linux-howto

http://stackoverflow.com – Very simple error I'm sure, just having a mental block for some reason! I have an object which contains an ArrayList of other objects. When I try to initialise the list in the constructor it does not seem to initialise and I get a nullpointer when I attempt to access the list within the code. Order class variables: private int covers; private int table; private ArrayList<MenuItem> items; Here is the Order class: public Order(int covers, int table) { super(); this.covers = covers; this.table = table; this.items = new ArrayList<MenuItem>(); } Here is t (HowTos)