wow..this is what i'm looking for!
thanks!
Type: Posts; User: iamhealed
wow..this is what i'm looking for!
thanks!
Ok, I know it needs to be static.
Is there anyway where I can force the compiler to get the current instance of a class ??
What I mean is, only MyClass can instantiate an object for MyClass....
OtherClassOutsidePackage
MyClass object = new MyClass();
object.getMyVar()
is this what you mean?
this is not safe because the class is instantiated everytime it is called. I want only one...
Hello everyone,
I am currently refactoring my codes and as much as possible i don't want to use static methods to avoid any conflicts when it comes to class instantiation.
Here's my problem,
...