1、
public class yy {
public static void main(String[] args) throws Exception{
try {
throw new Exception();
} catch (Exception e) {
System.out.println("Caught in main().");
}
System.out.println("nothing");
}
}
输出结果:
Caught in main().
nothing
2、
public static void main(String[] args) {
Thread t = new Thread() {
@Override
public void run() {
System.out.print("hello");
}
};
t.run();
System.out.print("world");
t.run();
}
输出结果:
helloworldhello
3、