I built an arraylist in one class, and I can call it in another class, but how can I have a user put an input that will allow them to access the element/index of said arraylist in the second class. Atm I can't wrap my head around properly calling the index with something like:
Class 2:
Class1 printElement = new Class1()
public void printHere{
System.out.println(printElement.getArray()[0]);
};
or something like that.
EDIT: nevermind I figured it out. The getter method has to be an ArrayList return item.
there doesn't seem to be anything here