Which code fragment, when inserted at line n1, prints 10 20 15 30?
A.
Stream.of(list1, list2)
.flatMap(list -> list.stream())
.forEach(s -> System.out.print(s + " "));
B.
Stream.of(list1, list2)
.fla...
Which statement is true?
A. Board does not compile.
B. Paper does not compile.
C. Frame does not compile.
D. Drawable does not compile.
E. All classes compile successfully.
Which code fragment, when inserted at line 1, enables the code to read the GDP from the user?
A. int GDP = Integer.parseInt(br.readline());
B. int GDP = br.read();
C. int GDP = br.nextInt();
D. int G...
You have been asked to create a ResourceBundle which uses a properties file to localize an application.
Which code example specifies valid keys of menu1 and menu2 with values of File Menu and View Me...
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).reserved().thenC...