最新的Oracle Java SE 8 Programmer II (1z0-809日本語版) - 1z0-809日本語免費考試真題
Given:
class FuelNotAvailException extends Exception { }
class Vehicle {
void ride() throws FuelNotAvailException {//line n1
System.out.println("Happy Journey!");
}
}
class SolarVehicle extends Vehicle {
public void ride () throws Exception {//line n2
super ride ();
}
}
and the code fragment:
public static void main (String[] args) throws FuelNotAvailException,
Exception {
Vehicle v = new SolarVehicle ();
v.ride();
}
Which modification enables the code fragment to print Happy Journey!?
class FuelNotAvailException extends Exception { }
class Vehicle {
void ride() throws FuelNotAvailException {//line n1
System.out.println("Happy Journey!");
}
}
class SolarVehicle extends Vehicle {
public void ride () throws Exception {//line n2
super ride ();
}
}
and the code fragment:
public static void main (String[] args) throws FuelNotAvailException,
Exception {
Vehicle v = new SolarVehicle ();
v.ride();
}
Which modification enables the code fragment to print Happy Journey!?
正確答案: B
Locale変数を正しく初期化する2つのコードブロックはどれですか?
正確答案: A,B
コードの断片を考えると:

結果は何ですか?

結果は何ですか?
正確答案: D
以下を含むGreetings.propertiesファイルを指定します。

and given:

結果は何ですか?

and given:

結果は何ですか?
正確答案: D
Given:
class Worker extends Thread {
CyclicBarrier cb;
public Worker(CyclicBarrier cb) { this.cb = cb; }
public void run () {
try {
cb.await();
System.out.println("Worker...");
} catch (Exception ex) { }
}
}
class Master implements Runnable { //line n1
public void run () {
System.out.println("Master...");
}
}
and the code fragment:
Master master = new Master();
//line n2
Worker worker = new Worker(cb);
worker.start();
You have been asked to ensure that the run methods of both the Worker and Master classes are executed.
どの修正が要件を満たしていますか?
class Worker extends Thread {
CyclicBarrier cb;
public Worker(CyclicBarrier cb) { this.cb = cb; }
public void run () {
try {
cb.await();
System.out.println("Worker...");
} catch (Exception ex) { }
}
}
class Master implements Runnable { //line n1
public void run () {
System.out.println("Master...");
}
}
and the code fragment:
Master master = new Master();
//line n2
Worker worker = new Worker(cb);
worker.start();
You have been asked to ensure that the run methods of both the Worker and Master classes are executed.
どの修正が要件を満たしていますか?
正確答案: A
次のコードフラグメントを考えてみましょう:
List<String> empDetails = Arrays.asList("100, Robin, HR",
「200、メアリー、管理サービス」
「101、ピーター、HR」);
empDetails.stream()
.filter(s->s.contains("1"))
.sorted()
.forEach(System.out::println); //行n1
結果はどうなりましたか?
List<String> empDetails = Arrays.asList("100, Robin, HR",
「200、メアリー、管理サービス」
「101、ピーター、HR」);
empDetails.stream()
.filter(s->s.contains("1"))
.sorted()
.forEach(System.out::println); //行n1
結果はどうなりましたか?
正確答案: A
コードの断片を考えると:

結果は何ですか?

結果は何ですか?
正確答案: C
コードの断片を考えると:
class MyThread implements Runnable {
private static AtomicInteger count = new AtomicInteger (0);
public void run () {
int x = count.incrementAndGet();
System.out.print (x+" ");
}
}
and
Thread thread1 = new Thread(new MyThread());
Thread thread2 = new Thread(new MyThread());
Thread thread3 = new Thread(new MyThread());
Thread [] ta = {thread1, thread2, thread3};
for (int x= 0; x < 3; x++) {
ta[x].start();
}
Which statement is true?
class MyThread implements Runnable {
private static AtomicInteger count = new AtomicInteger (0);
public void run () {
int x = count.incrementAndGet();
System.out.print (x+" ");
}
}
and
Thread thread1 = new Thread(new MyThread());
Thread thread2 = new Thread(new MyThread());
Thread thread3 = new Thread(new MyThread());
Thread [] ta = {thread1, thread2, thread3};
for (int x= 0; x < 3; x++) {
ta[x].start();
}
Which statement is true?
正確答案: B
与えられた:
IntStream stream = IntStream.of (1,2,3);
IntFunction<Integer> inFu= x -> y -> x*y;//line n1
IntStream newStream = stream.map(inFu.apply(10));//line n2
newStream.forEach(System.out::print);
どの修正により、コードフラグメントをコンパイルできますか?
IntStream stream = IntStream.of (1,2,3);
IntFunction<Integer> inFu= x -> y -> x*y;//line n1
IntStream newStream = stream.map(inFu.apply(10));//line n2
newStream.forEach(System.out::print);
どの修正により、コードフラグメントをコンパイルできますか?
正確答案: C
コードの断片を考えると:

行7に挿入されると、100の印刷を可能にするコードフラグメントはどれですか?

行7に挿入されると、100の印刷を可能にするコードフラグメントはどれですか?
正確答案: B
コードの断片を考えると:
class TechName {
String techName;
TechName (String techName) {
this.techName=techName;
}
}
and
List<TechName> tech = Arrays.asList (
new TechName("Java-"),
new TechName("Oracle DB-"),
new TechName("J2EE-")
);
Stream<TechName> stre = tech.stream();
//line n1
Which should be inserted at line n1 to print Java-Oracle DB-J2EE-?
class TechName {
String techName;
TechName (String techName) {
this.techName=techName;
}
}
and
List<TechName> tech = Arrays.asList (
new TechName("Java-"),
new TechName("Oracle DB-"),
new TechName("J2EE-")
);
Stream<TechName> stre = tech.stream();
//line n1
Which should be inserted at line n1 to print Java-Oracle DB-J2EE-?
正確答案: A

結果は何ですか?
正確答案: C
ベンダーは、どの3つのオブジェクトに対してJDBCドライバーの実装を提供する必要がありますか?
正確答案: A,B,D
說明:(僅 Fast2test 成員可見)