There is example that demonstrate above concept
public class Mainapp {
/**
* @param args
*/
static
{
System.out.println("hi...");
System.exit(0);
}
}
public class Mainapp {
/**
* @param args
*/
static
{
System.out.println("hi...");
System.exit(0);
}
}
O/P:
hi...
this is one of the important question ask in interviews...
plz go through it..