原题目一1:
public class mianshi1 {
@Test
public void test(){
new B();
}
}
class A{
static {
System.out.println("1");
}
{
System.out.println("1A");
}
}
class B extends A{
static {
System.out.println("2");
}
{
System.out.println("2B");
}
}//输出为1 2 1A 2B
题目2:
@Test
public void test1(){
try{
throw new ClassCastException();
}catch (ClassCastException ioe){
System.out.println("aa");
}catch (Exception e){
System.out.println("e");
}
}//只会抛出一个异常,这个虽然对了,但是要记一下