I am wanting to take user data in one method and pass that data to an "add" method, as to add said data to a generic arraylist. However I receive the following error message...
add (T) in List cannot be applied to (java.lang.String)
I'm not sure if this is a static problem or not...
My simplified code:
List<T> list = new ArrayList<T>();
void dataCollection() {
Scanner scan = new Scanner(System.in);
System.out.println("type data");
add(scan.next());
}
void add(T t) {
list.add(t);
}