The _________ loads Java bytecode to the memory. 所选答案: B.Java virtual machine 答案: A.class loader

声明 : 自己做的 不保证正确性

The _________ loads Java bytecode to the memory.
所选答案:
B.Java virtual machine
答案:
A.class loader
B.Java virtual machine
C.bytecode verifier
D.Java compiler
正确答案:
A.class loader

在这里插入图片描述
书本 p16

题号: 16
分数: 得 0 分,满分 5 分
问题: The relationship between an interface and the class that implements it is
你的答案:
1、 A.Composition :你选择了他 组成
2、 B.Aggregation 聚合
3、 C.None
4、 D.Inheritance 书上是 这个 选这个
正确答案:
4、 D.Inheritance 书上是 这个 选这个

在这里插入图片描述

interface 必须初始化 变量吗 ,是的
在这里插入图片描述

____________ is a device to connect a computer to a local area network (LAN).

所选答案:
A.DSL
答案:
A.DSL
B.NIC
C.Regular modem
D.Cable modem
正确答案:
B.NIC

在这里插入图片描述
书本 p5

Analyze the following code.

int x = 0;
if (x > 0);
{
  System.out.println("x");
}

所选答案:
A.Nothing is printed because x > 0 is false.

答案:
A.Nothing is printed because x > 0 is false.

B.The value of variable x is always printed.

C.The symbol x is always printed.

D.The symbol x is always printed twice.

正确答案:
B.The value of variable x is always printed.

因为
if (x > 0); 后面有个;

To declare a constant MAX_LENGTH as a member of the class, you write
所选答案:
E.final static float MAX_LENGTH = 99.98;
答案:
A.final static MAX_LENGTH = 99.98;
B.final static double MAX_LENGTH = 99.98;
C.final double MAX_LENGTH = 99.98;
D.static double MAX_LENGTH = 99.98;
E.final static float MAX_LENGTH = 99.98;
正确答案:
B.final static double MAX_LENGTH = 99.98;

https://blog.csdn.net/wo6317851/article/details/51055878
https://blog.csdn.net/tong_xin2010/article/details/27205025
我De_arning 说static 是让他只有一个

题号: 8
问题: Consider the following declaration for a class A.

class A {
    
    
  private int x;
  private int y;
  
  public A(int x, int y) {
    
    
    this.x = x;
    this.y = y;
  }
}

Class B is a subclass of A. Which of the following can be constructors in B?

I: 
public B() {
    
    
}

II:
public B(int x, int y) {
    
    
  super(x, y);
}

III:
public B() {
    
    
  super(0, 0);
}

IV:
public B(int x, int y) {
    
    
  this.x = x;
  this.y = y;
}

你的答案:
1、 A.II :你选择了他
2、 B.I
3、 C.III :你选择了他
4、 D.IV
猜测: acd

题号: 1
分数: 得 0 分,满分 1 分
问题: Analyze the following code:

class Test {
    
    
  public static void main(String[] args) {
    
    
    try {
    
    
      String s = "5.6";
      Integer.parseInt(s); // Cause a NumberFormatException

      int i = 0;
      int y = 2 / i;
    }
    catch (Exception ex) {
    
    
      System.out.println("NumberFormatException");
    }
    catch (RuntimeException ex) {
    
    
      System.out.println("RuntimeException");
    }
  }
}

你的答案:
1、 A.The program displays NumberFormatException.
2、 B.The program displays NumberFormatException followed by RuntimeException.
3、 C.The program displays RuntimeException. :你选择了他
4、 D.The program has a compilation error.
正确答案
4、 D.The program has a compilation error.

Exception ‘java.lang.RuntimeException’ has already been caught

题号: 15
分数: 得 0 分,满分 1 分
问题: Any number divided by 0 would generate an exception.
你的答案:
1、 A.true :你选择了他
2、 B.false
正确答案:
b
如果是 double 是可以的

题号: 16
分数: 得 0 分,满分 1 分
问题: Suppose you enter 34.3 57.8 789, then press the ENTER key. Analyze the following code.
Scanner input = new Scanner(System.in);
double v1 = input.nextDouble();
double v2 = input.nextDouble();
String line = input.nextLine();
你的答案:
1、 A.After the last statement is executed, line contains characters ’ ', ‘7’, ‘8’, ‘9’, ‘\n’.
2、 B.After the last statement is executed, line contains characters ‘7’, ‘8’, ‘9’.
3、 C.After the last statement is executed, line contains characters ’ ', ‘7’, ‘8’, ‘9’.
4、 D.After the last statement is executed, line contains characters ‘7’, ‘8’, ‘9’, ‘\n’. :你选择了他
正确答案:
3、 C.After the last statement is executed, line contains characters ’ ', ‘7’, ‘8’, '9’

题号: 19
分数: 得 0 分,满分 1 分
问题: The methods getMessage(), printStackTrace(), and toString() are available in ________ class.
你的答案:
1、 A.IOException
2、 B.Throwable :你选择了他
3、 C.Exception :你选择了他
4、 D.RuntimeException :你选择了他

   Throwable throwable= new Throwable();
        throwable.printStackTrace();
        throwable.getMessage();
        throwable.toString();

因为都没报错 我就觉得应该都对的吧,而且这些都是继承Throwable的,所以都有吧
猜测: abcd

猜你喜欢

转载自blog.csdn.net/jonathan_joestar/article/details/112984056