题库 软件开发 题目列表 定义如下程序: public class Person{ {...
单选题
定义如下程序:
public  class  Person{
    {
         System.out.println("P1");
    }
    static{
         System.out.println("P2");
    }
    public Person(){
         System.out.println("P3");
    }
}
public  class  Students extends Person{
    static{
        System.out.println("S1");
    }
    {
         System.out.println("S2");
    }
    public Students(){
         System.out.println("S3")
    }
    public static void  main(String[] args){
         new Students();
    }
}
程序执行结果是?()
A.

P1P2P3S1S2S3

B.

P1P2P3S2S1S3

C.

P2P1S1P3S2S3

D.

P2S1P1P3S2S3

题目信息
校招真题
-
正确率
0
评论
10
点击