Brandon_Campbell
asked on
How to get values from a different class in a separate package
I have a program with several packages in the source folder. All packages have public classes with public getters and setters.
I have a class that needs to get a HashMap from another class in a different package that has already been instantiated. I went the route of importing the class but I cannot get access to the values. I did look at reflection but this did not pan out for me. Am I missing something obvious? At a loss for the moment.
Thank you.
I have a class that needs to get a HashMap from another class in a different package that has already been instantiated. I went the route of importing the class but I cannot get access to the values. I did look at reflection but this did not pan out for me. Am I missing something obvious? At a loss for the moment.
Thank you.
you need to get the reference of that class instance and then access the hashmap through that instance.
Can you paste ur code ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
While the variable was static the getter was only public. When I set the getter to public static HashMap then everything worked great.
Thank you,
Thank you,