1. 程式人生 > 其它 >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

技術標籤:javajava

宣告 : 自己做的 不保證正確性

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