Why is this wrong? I can't use add, I am not sure how to. Some java documentation says I need to have add(index,data) but others are just add(data) and the compiler is support that as well. It is having an error with my data type.
import java.util.*;
public class graph1 {
public static void main (String[] args){
ArrayList<Node> web = new ArrayList<Node>();
web.add(0, "google", new int[]{1,2});
}
}
Node.java:
public class Node {
int i;
String title;
int[] links;
Node(int i, String title, int[] links){
this.i = i;
this.title = title;
this.links = links;
}
}