public class Test {
/**
* @param args
*/
// 1st way
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Test....!!!!!");
}
// 2nd way
static{
System.out.println("Test....!!!!!");
System.exit(1);
}
// 3rd way
private static int i = m1();
public static int m1(){
System.out.println("Test...!!!!");
System.exit(0);
return 0;
}
除此之外,我们可以通过其他方式打印消息吗?