I have a class with a static variable in it and now I want it to be accessed
from within a static method, but that method has an argument with the same
name. When referring to an object there is the 'this' keyword, but what to
do when you refer to the class itself?!
Daniel Pitts - 28 Mar 2007 21:16 GMT
> I have a class with a static variable in it and now I want it to be accessed
> from within a static method, but that method has an argument with the same
> name. When referring to an object there is the 'this' keyword, but what to
> do when you refer to the class itself?!
class MyClass {
private static int value;
public static void setValue(int value) {
MyClass.value = value;
}
}
Hope this helps,
Daniel.