see reehan ,
for interpreter of every lang. there is some enty point
in case of 'C' lang it is main() function
i.e while running the c prg the interpreter looks for main
function. same is in case of
java but static variables &
block has higher prority so all the static blocks r first
executed & the main method get's chance
hey do u know u can execute ur prg with out main method.
try this code
public class Mission_impossible
{
static
{
System.out.println("Who said main is required....?");
System.exit(0);
}
}
so the exection steps r as follows
1 : execute sataic block if any
2: initilize satatic variables if any
and lastly execute main method
hope this help u