Hi 'LL
Does static varibales and static block run and stored on stack while compliling source files(i.e while making class file???)???
this was the code I was doing
class Supcls{
static int i;
static{ i=20;}
}
the above code is stored in Supcls.java file
The below code stored in Test.java and both files stored in same package(default)
public class
Test {
static{System.out.println(Supcls.i);}
}
public static void main(
String[] args) {
Supcls supob=new Supcls();
}
}
when I ran the
java Test it is printing the value of static var i.
my question is when does the static variables /static block in Supcls initiated?
thnx
rishi
[ August 19, 2003: Message edited by: Rishi Wright ]