I have a small problem with doing calculations in one java class and trying to refer to the varibles in another class. I have written a GUI program that performs certain calculations and then when a button is pressed, the values obtained are saved as variables in another Java class ( called Calculations.class) . What I need to know is how can I access these variables again from another class so they can be used in further calculations.
matt_5104
0
Newbie Poster
Recommended Answers
Jump to PostIt depends on how your classes are designed. Can you use inheritance or packages to allow access? Otherwise you're either going to be hosed, or you have to make the members public.
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.