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{
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