MagicLen

分类

编程 - 第 51 页

编程的教学与经验分享,涵盖 Rust、Java、JavaScript、Go、C/C++ 等编程语言的入门教学、范例程序与实务技巧,以及算法、App 开发与开发工具的用法。

共 635 篇文章

[OCAJP] 逻辑相等

Which code fragment, when inserted at line 14, enables the code to print Mike Found? A. int f = ps.indexOf{new Patient("Mike")}; B. int f = ps.indexOf(Patient("Mike")); C. Patient p = new Patient("Mi...

[OCAJP] 电费帐单

How should you write methods in the ElectricAccount class at line n1 so that the member variable bill is always equal to the value of the member variable kwh multiplied by the member variable rate?

[OCAJP] 引入套件

Which code fragment, when inserted at line 2, enables the code to compile? A. import sales.*; B. import java.sales.products.*; C. import sales; import sales.products; D. import sales.*; import produc...

[OCAJP] 数值转型

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.

[OCAJP] 继承关系

Which two options fail to compile when placed at line n1 of the main method? A. employee.salary = 50_000; B. director.salary = 80_000; C. employee.budget = 200_000; D. manager.budget = 1_000_000; E. ...

[OCAJP] 构造器 2

Which code fragment should you use at line n1 to instantiate the dvd object successfully? A. super.r = r; this.c = c; B. super(r); this(c); C. super(r); this.c = c; D. this.c = r; super(c);