大学MOOC 面向对象程序设计B(新疆大学)1450285483 最新慕课完整章节测试答案
【第10周】类的继承与多态
第10章测验
1、单选题:
一个类被 final 修饰以后()
选项:
A: 这个类不能被继承
B: 这个类将不能被其他的类访问
C: 这个类必然有 final 的方法
D: 这个类不能调用其他的类
答案: 【 这个类不能被继承】
2、单选题:
设有两个类A、B,以下描述中表示B继承自A的是( )
选项:
A: class A extends B
B: class B implements A
C: class A implements
D: class B extends A
答案: 【 class B extends A】
3、单选题:
在子类中调用父类中被覆盖的方法时需要使用哪项关键字 ( )。
选项:
A: this
B: Super
C: new
D: 以上都不是
答案: 【 Super】
4、单选题:
分析下面两个类:class First{ final static int A=3;}final class Second extends First{ void method(){ System.out.println(A); }}下面说法正确的是( )。
选项:
A: 类First能被编译,但类Second不能。
B: 类Second能被编译,但类First不能。
C: 两个类都不能被编译。
D: 两个类都能被编译。
答案: 【 两个类都能被编译。】
5、单选题:
下面程序的运行结果是( )。class Animal{ public Animal(){ System.out.println("I'm an animal."); }}class Bird extends Animal{
