posted 18 years ago
Hi,
The Sequence is right but there is one more thing you might want to know
that is , after main method the non-static blocks(eg., blocks like {System.out.println();} ) are executed.Also, first the static variables are initialized with their default values(say 0 for int) then static blocks are executed in order of apperance and then the static variables are executed in order of their appearance
See the code below which shows the same.
and the o/p is:
---------- o/p ----------
static one
static two
5
one
three
two
hmm...
Bye & Regards,
Praveen
[ August 10, 2006: Message edited by: praveen babu ]
[ August 10, 2006: Message edited by: praveen babu ]
[ August 10, 2006: Message edited by: praveen babu ]