I am trying to create an ArrayList with multiple object types in Java. So far I have
import java.util.ArrayList;
public class DragRace {
public class Dragsters {
public String name;
public double rTime;
public int torque;
public double traction;
public int burnout;
}
ArrayList<Dragsters> dragsterList = new ArrayList<Dragsters>();
dragsterList.add("one", 0.6, 1000, 0.9, 3);
But it gives me the error
cannot resolve symbol 'add.'
I have searched on Google but could not find an answer that could be used in what I'm doing. Any help would be greatly appreciated. Thanks!
Dragstersobject first, then pass it in and see.