I was trying to figure out how to access variable values out of a class.

if class x.java hold all the values
can class y.java use getClass(??);
to get values without making a new class instance(which will erase everything?).
then class z.java access it later to get the values likewise?
What would that code have to look like?
thanks

you can use singleton design pattern

I was trying to figure out how to access variable values out of a class.

if class x.java hold all the values
can class y.java use getClass(??);
to get values without making a new class instance(which will erase everything?).
then class z.java access it later to get the values likewise?
What would that code have to look like?
thanks

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.