Author Topic:   Static methods
Alkesh Nandanwar
ranch hand
posted March 15, 2000 12:58 PM             
hi
Is there any way that static methods defined in a class can access the non-static variables or can call non-static methods?
ALkesh

maha anna
bartender
posted March 15, 2000 01:22 PM             
You have to create an instance of the class inside the static method, and from this instance you can access any (instance/class) members.
ex.
 
class Test {
void instMetod() { }
static void staticMethod() {
Test tst = new Test();
tst.instMethod();
}
}

regds
maha anna

|