[OCPJP] 单例模式
You want to create a singleton class by using the Singleton design pattern. Which two statements enforce the singleton nature of the design? A. Make the class static. B. Make the constructor private...
MagicLen · https://magiclen.org
本站也提供繁體中文版。切換到繁體中文版
分类
科学与科技类文章的总分类,包含编程与算法、操作系统、网络与服务器、网站与软硬件的介绍,以及数学逻辑、天文物理和生物化学的科普文章。
共 1507 篇文章
You want to create a singleton class by using the Singleton design pattern. Which two statements enforce the singleton nature of the design? A. Make the class static. B. Make the constructor private...
Which statement is true? A. A compilation error occurs in IceCream. B. A compilation error occurs in Cake. C. A compilation error occurs in Shop. D. A compilation error occurs in Bread E. All classes...
Which code fragment creates an instance of Car? A. Car auto = Car("MyCar")::new; B. Car auto = Car::new; Car vehicle = auto::getCar("MyCar"); C. Rideable rider = Car::new; Car vehicle = rider.getCar(...
Which code fragment, when inserted at line n1, sorts the employees list in descending order of fName and then ascending order of lName? A. .sorted(Comparator.comparing(Emp::getfName).reversed().thenC...
What is the result? A. 20.0 30.0 B. 10 20 C. A compilation error occurs. D. A NumberFormatException is thrown at run time.
Which two modifications enable the code to print Open Close? A. Replace line n1 with: class Folder implements AutoCloseable { B. Replace line n1 with: class Folder extends Closeable { C. Replac...
For which three objects must a vendor provide implementations in its JDBC driver?
What is the result? A. Scan.Printer closed. Scanner closed. Unable to scan. B. Scan.Scanner closed. Unable to scan. C. Scan. Unable to scan. D. Scan. Unable to scan. Printer closed.
What is the result? A. User is registered. B. An AgeOutOfLimitException is thrown. C. A UserException is thrown. D. A compilation error occurs in the main method.
Which modification enables the code fragment to compile? A. Replace line n1 with: IntFunction<UnaryOperator> inFu = x -> y -> x * y; B. Replace line n1 with: IntFunction<IntUnaryOperator> inFu = x ->...