Which of the following can be the body of a lambda expression?
Correct Answer:C
Given: java
var frenchCities = new TreeSet
System.out.println(frenchCities.headSet("Marseille")); What will be printed?
Correct Answer:C
Which of the following statements are correct?
Correct Answer:E
Given: java
package com.vv;
import java.time.LocalDate; public class FetchService {
public static void main(String[] args) throws Exception { FetchService service = new FetchService();
String ack = service.fetch(); LocalDate date = service.fetch();
System.out.println(ack + " the " + date.toString());
}
public String fetch() { return "ok";
}
public LocalDate fetch() { return LocalDate.now();
}
}
What will be the output?
Correct Answer:B
What do the following print? java
import java.time.Duration;
public class DividedDuration {
public static void main(String[] args) { var day = Duration.ofDays(2); System.out.print(day.dividedBy(8));
}
}
Correct Answer:A
Given: java
double amount = 42_000.00;
NumberFormat format = NumberFormat.getCompactNumberInstance(Locale.FRANCE, NumberFormat.Style.SHORT);
System.out.println(format.format(amount)); What is the output?
Correct Answer:D