Sounds to me like you want MyClass to be a Singleton Object.
That would look like:
public class MyClass {
private static MyClass ref;
private myvar;
//Private constructor for...
Type: Posts; User: aussiemcgr
Sounds to me like you want MyClass to be a Singleton Object.
That would look like:
public class MyClass {
private static MyClass ref;
private myvar;
//Private constructor for...
Then it needs to be static.
Create a MyClass object and call the getMyvar() method.