单选题

1fbaf7da6528422c72b405bf75e68f8d.png

A、

May 04, 2014T00:00:00.000

B、

2014-05-04T00:00: 00.000

C、

5/4/14T00:00:00.000

D、

An exception is thrown at runtime.

下载APP答题
由4l***fp提供 分享 举报 纠错

相关试题

单选题 What is the name of the Java concept that uses access modifiers to protect variables and hide them within a class?

在 Java 中,使用访问修饰符来保护变量并将其隐藏在类中的概念叫什么?

A. 封装 (Encapsulation)
B. 继承 (Inheritance)
C. 抽象 (Abstraction)
D. 实例化 (Instantiation)
E. 多态性 (Polymorphism)

A、

Encapsulation

B、

Inheritance

C、

Abstraction

D、

Instantiation

E、 Polymorphism

单选题 What is the result?

A、 Sum is 600
B、 Compilation fails at line n1.
C、 Compilation fails at line n2.
D、 A ClassCastException is thrown at line n1.
E、 A ClassCastException is thrown at line n2.

单选题 What is the result?

A、 Compilation fails at line n1.
B、 Initialized Started Initialized
C、 Initialized Started
D、 Compilation fails at line n2.

单选题 576c85f95d781ff741a34d17df45bdd0.png

要求:

由 Customer 类实例表示的任何用电量(通过调用 useElectricity 方法)必须计算到 bill(账单)中。不能允许 Customer 类实例直接篡改 bill 的值或减少其值。bill 的值必须始终等于 kWh 乘以 rate。

问题:
如何在 ElectricAccount 类中的 Line n1 实现方法,以确保 bill 始终等于 kWh 乘以 rate?

A、

Public void addKWh(double kWh) { this.kWh += kWh; this.bill = this.kWh ∗ this.rate; }

B、

Public void add KWh(double kWh) { if (kWh > 0) { this.kWh += kWh; this.bill = this.kWh ∗ this.rate; } }

C、

Private void add KWh(double kWh) { if (kWh > 0) { this.kWh += kWh; this.bill = this.kWh ∗ this.rate; } }

D、

Public void add KWh(double kWh) { if (kWh > 0) { this.kWh += kWh; setBill(this.kWh); } } PublicvoidsetBill(double kWh) { bill = kWh ∗ rate; }

单选题 2ba876caac1654e06b69fbc5b905aab3.png

A、

4W 100 Auto 4W 150 Manual

B、

null 0 Auto 4W 150 Manual

C、

Compilation fails only at line n1

D、

Compilation fails only at line n2

E、 Compilation fails at both line n1 and line n2

单选题

A、 Match 1
B、 Match 2
C、 No Match
D、 A NullPointerException is thrown at runtime.

单选题 Which statement is true about the switch statement?

关于 switch 语句,下列哪项是正确的?

A. 它必须包含 default 部分。
B. 每个 case 块末尾的 break 语句是可选的。
C. 它的 case 标签字面量可以在运行时更改。
D. 它的表达式必须计算为一个值集合。

A、

It must contain the default section.

B、

The break statement, at the end of each case block, is optional.

C、

Its case label literals can be changed at runtime.

D、

Its expression must evaluate to a collection of values.

单选题 What is the result?

A、 200.0 : 100.0
B、 400.0 : 200.0
C、 400.0 : 100.0
D、 Compilation fails.