Beijing University of Posts and Telecommunications "high-level language programming" with the answer to the third stage of work

A multiple-choice (a total of 20 small problem, a total 100.0 points)

1. Which of the following modifiers modified variables are all of the same class generated object sharing? ____

A. public

B. private

C. static

D. final

Knowledge points:

The third unit self-test pass

Student answers:

[A;]

Score:

[5]

Questions scores:

5.0

prompt:

2. Which of the following is the correct definition of the interface of _____

A. interface  A
{void print()  {  } ;}

B. abstract  interface  A
{void print() ;}

C. abstract interface A extends I1, I2 // I1, I2 of the interface defined
abstract void print () {}; }

D. interface  A
{void print();}

Knowledge points:

The third unit self-test pass

Student answers:

[D;]

Score:

[5]

Questions scores:

5.0

prompt:

3. With regard to interfaces and abstract classes, the right is ____

A. An abstract class can have a constructor

B. interface can have constructor

C. new operator can operate an abstract class

D. new operator can operate an interface

Knowledge points:

The third unit self-test pass

Student answers:

[A;]

Score:

[5]

Questions scores:

5.0

prompt:

4. The following statement is correct ____

A. subclass can override methods in parent classes, but can not overload

B. subclass can overload the parent class method, not covered

C. subclasses can not define and shape with the same name as the parent class method parameter, otherwise the system will not know which method to use

Overload class D. There is a different method of formal parameters and methods have the same name but a plurality of body

Knowledge points:

The third unit self-test pass

Student answers:

[D;]

Score:

[5]

Questions scores:

5.0

prompt:

5. With regard to the abstract class, the correct ____

A. abstract class can not have non-abstract class

B. a non-abstract parent class is an abstract class, subclass must all abstract methods of the parent class overloads

C. absolutely can not be used to create objects of abstract classes

D. abstract classes and interfaces are all about

Knowledge points:

The third unit self-test pass

Student answers:

[C;]

Score:

[5]

Questions scores:

5.0

prompt:

6. When the constructor is called, ____

A. subclass definition may be used without using all of the parent class constructor

B. can be used regardless of whether the default constructor when the class constructor defines what kind of object creation

C. First call the constructor of the parent class

D. called first multi-parameter constructor

Knowledge points:

The third unit self-test pass

Student answers:

[A;]

Score:

[5]

Questions scores:

5.0

prompt:

7. With regard to the right argument constructor is ____

A. A class can have a constructor

B. A class can have a plurality of different names of the constructor

C. The constructor function of the same name

D. constructor must define your own, you can not use the constructor of the parent class

Knowledge points:

The third unit self-test pass

Student answers:

[C;]

Score:

[5]

Questions scores:

5.0

prompt:

8. The method of shape parameters ____

You must define a plurality of parameter A.

B. At least one

C. can not

D. can only be a simple variable

Knowledge points:

The third unit self-test pass

Student answers:

[C;]

Score:

[5]

Questions scores:

5.0

prompt:

9. The method of variables within ____

A. must all locations visible inside method

B. Possible methods can be found in the local

C. The method can be seen in the outer

The method may be an outer D.

Knowledge points:

The third unit self-test pass

Student answers:

[B;]

Score:

[5]

Questions scores:

5.0

prompt:

10. The following statement is correct ____

A. Abstract final class Hh{……}

B. Abstract private move(){……}

C. Protected private number;

D. Public abstract class Car{……}

Knowledge points:

The third unit self-test pass

Student answers:

[B;]

Score:

[5]

Questions scores:

5.0

prompt:

11. is declared as private, protected and public class members, the class outside ____

A. members can access only the declared public

B. only have access to declared as protected and members of the public

C. can access

D. can not access

Knowledge points:

The third unit self-test pass

Student answers:

[A;]

Score:

[5]

Questions scores:

5.0

prompt:

12. The following statement is correct ____

A. a program may contain multiple source files

B. A source file can have only one class

C. a source file can have multiple public classes

D. a source file for a program to use only

Knowledge points:

The third unit self-test pass

Student answers:

[A;]

Score:

[5]

Questions scores:

5.0

prompt:

13. With regard to the private access specifier private member variable modified, the following statement is correct _____

A. three types can be cited: the class itself, and its subclasses other classes in the same package in another class package

B. can be two types of access and references: the class itself, all subclasses of the class

C. can only be accessed and modified the class itself

D. class can only be accessed with a package

Knowledge points:

Theme 8 self-test

Student answers:

[C;]

Score:

[5]

Questions scores:

5.0

prompt:

14. The following program error, saying the cause of the error is correct

public class App {
int x = 8;
System.out.println("K");
public static void main(String[] mm) {
}
}

A. 语句“int x = 8;”有错,不能在声明变量的同时赋值

B. 语句“System.out.println("K");”有错,这样的操作性语句必须放到某个方法的方法体中才行

C. main() 方法的方法体中没有任何语句,所以产生错误

D. main() 方法中的参数应该是 args,而这里写成了mm,所以出错

知识点:

主题8自测

学生答案:

[B;]

得分:

[5]

试题分值:

5.0

提示:

15. 关于方法的说法正确的是_____

A. 方法中的形参可以和方法所属类的属性同名

B. 方法必须有形参

C. 同类不同的方法中不能有同名的自变量,否则会产生不可预测的结果

D. 没有返回值的方法可以用void来表示,也可以不加

知识点:

主题8自测

学生答案:

[A;]

得分:

[5]

试题分值:

5.0

提示:

16. 下列说法中正确的是______

A. 不需要定义类就能创建对象

B. 对象中必须有属性和方法

C. 属性必须是简单变量

D. 属性可以是简单变量,也可以是一个对象

知识点:

主题8自测

学生答案:

[D;]

得分:

[5]

试题分值:

5.0

提示:

17. 下列关于修饰符混用的说法,错误的是

A. abstract不能与final并列修饰同一个类

B. abstract类中不可以有private的成员

C. abstract方法必须在abstract类中

D. static方法中能处理非static的属性

知识点:

主题9自测

学生答案:

[D;]

得分:

[5]

试题分值:

5.0

提示:

18. 类与对象的关系是___

A. 类是对象的抽象

B. 类是对象的具体实例

C. 对象是类的抽象

D. 对象是类的子类

知识点:

主题9自测

学生答案:

[A;]

得分:

[5]

试题分值:

5.0

提示:

19. 下列关于构造方法的叙述中,错误的是____

A. Java语言规定构造方法名与类名必须相同

B. Java语言规定构造方法没有返回值,但不用void声明

C. Java语言规定构造方法不可以重载

D. Java语言规定构造方法只能通过new自动调用

知识点:

主题9自测

学生答案:

[C;]

得分:

[5]

试题分值:

5.0

提示:

20. 关于继承的说法正确的是____

A. 子类将继承父类所有的属性和方法

B. 子类继承父类的非私有属性和方法

C. 子类只继承父类public方法和属性

D. 子类只继承父类的方法,而不继承属性

知识点:

主题9自测

学生答案:

[B;]

得分:

[5]

试题分值:

5.0

提示:

读书和健身总有一个在路上

Guess you like

Origin www.cnblogs.com/Renqy/p/11543375.html