1z1-830試験無料問題集「Oracle Java SE 21 Developer Professional 認定」
Given:
java
DoubleSummaryStatistics stats1 = new DoubleSummaryStatistics();
stats1.accept(4.5);
stats1.accept(6.0);
DoubleSummaryStatistics stats2 = new DoubleSummaryStatistics();
stats2.accept(3.0);
stats2.accept(8.5);
stats1.combine(stats2);
System.out.println("Sum: " + stats1.getSum() + ", Max: " + stats1.getMax() + ", Avg: " + stats1.getAverage()); What is printed?
java
DoubleSummaryStatistics stats1 = new DoubleSummaryStatistics();
stats1.accept(4.5);
stats1.accept(6.0);
DoubleSummaryStatistics stats2 = new DoubleSummaryStatistics();
stats2.accept(3.0);
stats2.accept(8.5);
stats1.combine(stats2);
System.out.println("Sum: " + stats1.getSum() + ", Max: " + stats1.getMax() + ", Avg: " + stats1.getAverage()); What is printed?
正解:A
解答を投票する
解説: (GoShiken メンバーにのみ表示されます)
Given:
java
StringBuffer us = new StringBuffer("US");
StringBuffer uk = new StringBuffer("UK");
Stream<StringBuffer> stream = Stream.of(us, uk);
String output = stream.collect(Collectors.joining("-", "=", ""));
System.out.println(output);
What is the given code fragment's output?
java
StringBuffer us = new StringBuffer("US");
StringBuffer uk = new StringBuffer("UK");
Stream<StringBuffer> stream = Stream.of(us, uk);
String output = stream.collect(Collectors.joining("-", "=", ""));
System.out.println(output);
What is the given code fragment's output?
正解:D
解答を投票する
解説: (GoShiken メンバーにのみ表示されます)
Given:
java
public class BoomBoom implements AutoCloseable {
public static void main(String[] args) {
try (BoomBoom boomBoom = new BoomBoom()) {
System.out.print("bim ");
throw new Exception();
} catch (Exception e) {
System.out.print("boom ");
}
}
@Override
public void close() throws Exception {
System.out.print("bam ");
throw new RuntimeException();
}
}
What is printed?
java
public class BoomBoom implements AutoCloseable {
public static void main(String[] args) {
try (BoomBoom boomBoom = new BoomBoom()) {
System.out.print("bim ");
throw new Exception();
} catch (Exception e) {
System.out.print("boom ");
}
}
@Override
public void close() throws Exception {
System.out.print("bam ");
throw new RuntimeException();
}
}
What is printed?
正解:A
解答を投票する
解説: (GoShiken メンバーにのみ表示されます)