Saturday, 19 March 2011

Executing a Main() Twice

class Sample{
 
        static{
                main(null);
        }
 
              public static void main(String [] args){
 
                   System.out.println("Main Executed.");
              }
        }

2 comments:

Anonymous said...

The call in static block is not same as main called by JVM.

மரிய சேகர் ( Maria Sekar) said...

Calling is different however the method is same.