Oracle Java SE 8 Programmer II (1z0-809日本語版) - 1z0-809日本語 Exam Practice Test
コードの断片を考えると:
UnaryOperator<Integer> uo1 = s -> s*2;line n1
List<Double> loanValues = Arrays.asList(1000.0, 2000.0);
loanValues.stream()
.filter(lv -> lv >= 1500)
.map(lv -> uo1.apply(lv))
.forEach(s -> System.out.print(s + " "));
What is the result?
UnaryOperator<Integer> uo1 = s -> s*2;line n1
List<Double> loanValues = Arrays.asList(1000.0, 2000.0);
loanValues.stream()
.filter(lv -> lv >= 1500)
.map(lv -> uo1.apply(lv))
.forEach(s -> System.out.print(s + " "));
What is the result?
Correct Answer: C
Given:
class Bird {
public void fly () { System.out.print("Can fly"); }
}
class Penguin extends Bird {
public void fly () { System.out.print("Cannot fly"); }
}
and the code fragment:
class Birdie {
public static void main (String [ ] args) {
fly( ( ) -> new Bird ( ));
fly (Penguin : : new);
}
/* line n1 */
}
Which code fragment, when inserted at line n1, enables the Birdie class to compile?
class Bird {
public void fly () { System.out.print("Can fly"); }
}
class Penguin extends Bird {
public void fly () { System.out.print("Cannot fly"); }
}
and the code fragment:
class Birdie {
public static void main (String [ ] args) {
fly( ( ) -> new Bird ( ));
fly (Penguin : : new);
}
/* line n1 */
}
Which code fragment, when inserted at line n1, enables the Birdie class to compile?
Correct Answer: B
与えられた情報: 従業員テーブルには 10 件のレコードがあります。
次のコードフラグメントを考えてみましょう:

結果はどうなりましたか?
次のコードフラグメントを考えてみましょう:

結果はどうなりましたか?
Correct Answer: C
コードの断片を考えると:

そして

結果は何ですか?

そして

結果は何ですか?
Correct Answer: D
コンテンツを考えると:

とコードの断片:

結果は何ですか?

とコードの断片:

結果は何ですか?
Correct Answer: C
Given the code fragment:
public static void main (String[] args) throws IOException {
BufferedReader brCopy = null;
try (BufferedReader br = new BufferedReader (new
FileReader("employee.txt"))) { //
line n1
br.lines().forEach(c -> System.out.println(c));
brCopy = br;//line n2
}
brCopy.ready(); //line n3;
}
BufferedReaderのreadyメソッドが閉じたBufferedReaderで呼び出されたときに例外をスローし、employee.txtがアクセス可能で有効なテキストを含んでいると仮定します。
結果は何ですか?
public static void main (String[] args) throws IOException {
BufferedReader brCopy = null;
try (BufferedReader br = new BufferedReader (new
FileReader("employee.txt"))) { //
line n1
br.lines().forEach(c -> System.out.println(c));
brCopy = br;//line n2
}
brCopy.ready(); //line n3;
}
BufferedReaderのreadyメソッドが閉じたBufferedReaderで呼び出されたときに例外をスローし、employee.txtがアクセス可能で有効なテキストを含んでいると仮定します。
結果は何ですか?
Correct Answer: B
Given:

and this code fragment:

What is the result?

and this code fragment:

What is the result?
Correct Answer: C
コードの断片を考えると:
interface CourseFilter extends Predicate<String> {
public default boolean test (String str) {
return str.contains ("Java");
}
}
and
List<String> strs = Arrays.asList("Java", "Java EE", "Embedded Java");
Predicate<String> cf1 = s - > s.length() > 3;
Predicate cf2 = new CourseFilter() { //line n1
public boolean test (String s) {
return s.startsWith ("Java");
}
};
long c = strs.stream()
.filter(cf1)
.filter(cf2//line n2
.count();
System.out.println(c);
結果は何ですか?
interface CourseFilter extends Predicate<String> {
public default boolean test (String str) {
return str.contains ("Java");
}
}
and
List<String> strs = Arrays.asList("Java", "Java EE", "Embedded Java");
Predicate<String> cf1 = s - > s.length() > 3;
Predicate cf2 = new CourseFilter() { //line n1
public boolean test (String s) {
return s.startsWith ("Java");
}
};
long c = strs.stream()
.filter(cf1)
.filter(cf2//line n2
.count();
System.out.println(c);
結果は何ですか?
Correct Answer: B
コードの断片を考えると:

結果は何ですか?

結果は何ですか?
Correct Answer: B