Hi there,
Kinda new to Java, and trying to reference the class that created an instance of the class i am referencing from.
i.e.
If Class A creates an instance of Class B, how can i write code in Class B that accesses a member (a variable in this case) of Class A. The instance of Class B was created under the default constructor public B(){...}
I did try searching the forum but wasnt quite sure what to search for. Im sure this must be very simple.
Thanks in advance
Kinda new to Java, and trying to reference the class that created an instance of the class i am referencing from.
i.e.
If Class A creates an instance of Class B, how can i write code in Class B that accesses a member (a variable in this case) of Class A. The instance of Class B was created under the default constructor public B(){...}
I did try searching the forum but wasnt quite sure what to search for. Im sure this must be very simple.
Thanks in advance