The teacher’s words helped the students gain () into the problem.
A、ideas
B、views
C、insight
D、understanding
第1题:
类Teacher和Student都是类Person的子类 Person p; Teacher t; Student s; 若p,t和s都是非空值 if(t instanceof Person) { s = (Student)t; } 若默认new时声明的都是本类,这个语句导致的结果是()
A.将构造一个Student对象
B.表达式合法
C.编译时非法
D.编译时合法而在运行时可能非法
第2题:
以下选项中哪个是Student类创建对象的正确语句?()
A.Student s1=new Student();
B.s1=new Student();
C.s1=Student();
D.Student s1=Student();
第3题:
以下选项中哪个是Student类创建对象的正确语句?()
A.s1=new Student();
B.Student s1=new Student();
C.s1=Student();
D.Student s1=Student();
第4题:
类 Teacher 和 Student 是类 Person 的子类; Teacher t; Student s; // t and s are all non-null. if (t instanceof Person ){ s=(Student)t; } 最后一条语句的结果是:
A.将构造一个Student 对象;
B.表达式是合法的;
C.表达式是错误的;
D.编译时正确, 但运行时错误。
第5题:
声明并创建一个学生类Student的对象s,下列语法格式正确的是()。
A.Student s = Student();
B.Student s;
C.Student s = new Student();
D.Student s = new ();