So lets say that in my entry point class (i.e the class which runs when the program starts (which has the public static void main(String args[])
function). In that class I have this variable:
private ArrayList<String> myData=new ArrayList<String>();
This class instantiates another class, which needs to have access to the myData
member of the entry point class. How can it retrieve this arraylist?
Edit: To clarify, in the main()
method I could do this:
SomeOtherClass myClass=new SomeOtherClass();
and then I could do:
myClass.someMethod();
however, in the myClass
object, how could I perform a method/retrieve something from the entry class, which instantiated the myClass
object?