Well hi there! I am making a game called DoorElementals, and I want to do this:
ArrayList<Color> colors = new ArrayList<Color>();
public Door(Color... colors) {
this.colors.add(colors);
}
public void addColor(Color... c){
this.colors.add(c);
}
But colors is an array while this.colors is an ArrayList.
How should I go about this?
Colorto theArrayListchange it likeArrayList<Color[]> colors = new ArrayList<>();addAll(Arrays.asList(colors))?for (Color c : colors) {this.colors.add(c);}works too.