Chest is a different class which I want to make into an object, inside the chest class I just want to declare it with a bunch of values including an ArrayList which will be ints
How can I format this correctly? Thank you so much for any help!
It doesn't compile correctly.
Chest chest = new Chest(0,0,0, {0},false,false);
Hopefully this makes sense what I'm trying to do
this is the arrayList in the other class
import java.util.*;
public class Chest
{
public ArrayList<Integer> idList;
public boolean closed;
public boolean opened;
public Chest(int xpos, int ypos, int numContents, ArrayList<Integer> idList, boolean opened, boolean closed)
{
this.closed = true;
this.opened = false;
}
}
How I fixed it
Chest chest = new Chest(0,0,0, new ArrayList<Integer>(),false,false);
Thank you micha!