Want to pass your Java SE 11 Programmer II 1Z0-816 exam in the very first attempt? Try Pass2lead! It is equally effective for both starters and IT professionals.
VCE
var numbers = List.of(0,1,2,3,4,5,6,7,8,9);
You want to calculate the average of numbers.
Which two codes will accomplish this? (Choose two.)
A. double avg = numbers.stream().parallel().averagingDouble(a -> a);
B. double avg = numbers.parallelStream().mapToInt (m -> m).average().getAsDouble();
C. double avg = numbers.stream().mapToInt (i -> i).average().parallel();
D. double avg = numbers.stream().average().getAsDouble();
E. double avg = numbers.stream().collect(Collectors.averagingDouble(n -> n));
Given the contents:
MessageBundle.properties file:
message=Hello
MessageBundle_en.properties file:
message=Hello (en)
MessageBundle_US.properties file:
message=Hello (US)
MessageBundle_en_US.properties file:
message=Hello (en_US)
MessageBundle_fr_FR.properties file:
message=Bonjour
and the code fragment:
Locale.setDefault(Locale.FRANCE);
Locale currentLocale = new Locale.Builder().setLanguage("en").build();
ResourceBundle messages = ResourceBundle.getBundle("MessageBundle", currentLocale);
System.out. println(messages.getString("message"));
Which file will display the content on executing the code fragment?
A. MessageBundle_en_US.properties
B. MessageBundle_en.properties
C. MessageBundle_fr_FR.properties
D. MessageBundle_US.properties
E. MessageBundle.properties
Which interface in the java.util.function package can return a primitive type?
A. ToDoubleFunction
B. Supplier
C. BiFunction
D. LongConsumer