I am trying to add instanes of a class(basically a node) to my arraylist. How do i go about doing this? heres what i have:
public class Sentence {
String word;
public Sentence(String word){
this.word=word;
}
}
and then in another class:
ArrayList<Object> holder= new ArrayList<Object>();
Sentence node;
String name;
//Something to initialize/set name
holder.add(new node(name));
Bu that doesnt seem to work, i get error: cannot find symbol for node.