Thursday, November 18, 2010

You can execute marker() method in the following way without touching main method by calling that method from a static block

You can execute marker() method in the following way without touching main method by calling that method from a static block.....The code is as follow

class
testTrick{

static{
marker();
}
public static void main(String args[]){
//testTrick.marker();
}

static void marker(){

System.out.print("programe executed");

}

}

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...