单选题 Given:

505e4de6899e5d121a614fa204f9b6e3.png

Which option fails?

A、 Foo mark = new Foo (“Steve”, 100);
B、 Foo pair = Foo.twice (“Hello World!”);
C、 Foo percentage = new Foo(“Steve”, 100);
D、 Foo grade = new Foo <> (“John”, “A”);
下载APP答题
由4l***qf提供 分享 举报 纠错

相关试题

单选题 Given: What is the result of running the code with the –ea option?

A、-10
B、0
C、An AssertionError is thrown.
D、A compilation error occurs.

单选题 Given the code fragments:

And

What is the result?

A、Video played.Game played.
B、A compilation error occurs.
C、class java.lang.Exception
D、class java.io.IOException

单选题 Given the code fragment:


What is the result?

A、Searching...
B、Searching... Searching...
C、Searching... Searching... Searching...
D、A compilation error occurs.

单选题
and the code fragment?

What is the result?

A、$15.00
B、15 $
C、USD 15.00
D、USD $15

单选题 Given the content of the employee.txt file:
Every worker is a master.
Given that the employee.txt file is accessible and the file allemp.txt does NOT exist, and the code fragment:
What is the result?

A、Exception 1
B、Exception 2
C、The program executes, does NOT affect the system, and produces NO output.
D、allemp.txt is created and the content of employee.txt is copied to it.

单选题 Given the code fragment:

What is the result?

A、Hello : Jim Hello : John Hello : Jeff
B、Jim John Jeff
C、The program prints nothing.
D、A compilation error occurs.

单选题 Given:

7c0061b844e12ddffc76945a88df82c5.png

And the code fragment:

ec89247fd99cb1fa6074ad44ae2b60ec.png

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).reserved().thenComparing (Emp::getlName))
B、.sorted (Comparator.comparing(Emp::getfName).thenComparing(Emp::getlName))
C、.map(Emp::getfName).sorted(Comparator.reserveOrder())
D、.map(Emp::getfName).sorted(Comparator.reserveOrder().map (Emp::getlName).reserved

单选题 Given the code fragment:

6753753cebd5a31ea9f5c63570613791.png

Which code fragment, when inserted at line n1, ensures false is printed?

A、boolean b = cs.stream() .findAny() .get() .equals(“Java”);
B、boolean b = cs.stream() .anyMatch (w -> w.equals (“Java”));
C、boolean b = cs.stream() .findFirst() .get() .equals(“Java”);
D、boolean b = cs.stream() .allMatch(w -> w.equals(“Java”));