I have class A which extends the Activity class. This class is in package aaa. I have class B which is in package aaa.extensions. What is the best way to access variables in class A?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Either I am not understanding well the question or it is really basic. What you need to do is provide access methods in your class A so any other class in whatever package it is could have access to that “variable” declared inside your class A by just giving an instance of A to any other class that wants/needs to access its internal state.