Oracle Java SE 8 Programmer II (1z0-809日本語版) - 1z0-809日本語 Exam Practice Test
コードの断片を考えると:

結果は何ですか?

結果は何ですか?
Correct Answer: A
コードの断片を考えると:
public class FileThread implements Runnable {
String fName;
public FileThread(String fName) { this.fName = fName; }
public void run () System.out.println(fName);}
public static void main (String[] args) throws IOException,
InterruptedException {
ExecutorService executor = Executors.newCachedThreadPool();
Stream<Path> listOfFiles = Files.walk(Paths.get("Java Projects"));
listOfFiles.forEach(line -> {
executor.execute(new FileThread(line.getFileName().toString())); //
line n1
});
executor.shutdown();
executor.awaitTermination(5, TimeUnit.DAYS);//
line n2
}
}
The Java Projects directory exists and contains a list of files.
What is the result?
public class FileThread implements Runnable {
String fName;
public FileThread(String fName) { this.fName = fName; }
public void run () System.out.println(fName);}
public static void main (String[] args) throws IOException,
InterruptedException {
ExecutorService executor = Executors.newCachedThreadPool();
Stream<Path> listOfFiles = Files.walk(Paths.get("Java Projects"));
listOfFiles.forEach(line -> {
executor.execute(new FileThread(line.getFileName().toString())); //
line n1
});
executor.shutdown();
executor.awaitTermination(5, TimeUnit.DAYS);//
line n2
}
}
The Java Projects directory exists and contains a list of files.
What is the result?
Correct Answer: B

結果は何ですか?
Correct Answer: 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
結果はどうなりましたか?
Correct Answer: C
Given:

and this code fragment:

What is the result?

and this code fragment:

What is the result?
Correct Answer: C
コードの断片を考えると:
class CallerThread implements Callable<String> {
String str;
public CallerThread(String s) {this.str=s;}
public String call() throws Exception {
return str.concat("Call");
}
}
and
public static void main (String[] args) throws InterruptedException,
ExecutionException
{
ExecutorService es = Executors.newFixedThreadPool(4); //line n1
Future f1 = es.submit (newCallerThread("Call"));
String str = f1.get().toString();
System.out.println(str);
}
どちらの説明が正しいですか?
class CallerThread implements Callable<String> {
String str;
public CallerThread(String s) {this.str=s;}
public String call() throws Exception {
return str.concat("Call");
}
}
and
public static void main (String[] args) throws InterruptedException,
ExecutionException
{
ExecutorService es = Executors.newFixedThreadPool(4); //line n1
Future f1 = es.submit (newCallerThread("Call"));
String str = f1.get().toString();
System.out.println(str);
}
どちらの説明が正しいですか?
Correct Answer: A
Given:
public class Canvas implements Drawable {
public void draw () { }
}
public abstract class Board extends Canvas { }
public class Paper extends Canvas {
protected void draw (int color) { }
}
public class Frame extends Canvas implements Drawable {
public void resize () { }
}
public interface Drawable {
public abstract void draw ();
}
どちらの説明が正しいですか?
public class Canvas implements Drawable {
public void draw () { }
}
public abstract class Board extends Canvas { }
public class Paper extends Canvas {
protected void draw (int color) { }
}
public class Frame extends Canvas implements Drawable {
public void resize () { }
}
public interface Drawable {
public abstract void draw ();
}
どちらの説明が正しいですか?
Correct Answer: E
Studentテーブルの構造を考えると:
学生(id INTEGER、name VARCHAR)
STUDENTテーブルのレコードを考えると:

コードの断片を考えると:

と仮定する:
結果は何ですか?
学生(id INTEGER、name VARCHAR)
STUDENTテーブルのレコードを考えると:

コードの断片を考えると:

と仮定する:
結果は何ですか?
Correct Answer: D
コードの断片を考えると:
Stream<Path> files = Files.list(Paths.get(System.getProperty("user.home"))); files.forEach (fName -> {//line n1 try { Path aPath = fName.toAbsolutePath();//line n2 System.out.println(fName + ":"
+ Files.readAttributes(aPath, Basic.File.Attributes.class).creationTime ());
} catch (IOException ex) {
ex.printStackTrace();
});
結果は何ですか?
Stream<Path> files = Files.list(Paths.get(System.getProperty("user.home"))); files.forEach (fName -> {//line n1 try { Path aPath = fName.toAbsolutePath();//line n2 System.out.println(fName + ":"
+ Files.readAttributes(aPath, Basic.File.Attributes.class).creationTime ());
} catch (IOException ex) {
ex.printStackTrace();
});
結果は何ですか?
Correct Answer: A
EMPLOYEE テーブルがあるとします。

次のコードフラグメントを考えてみましょう:

データベースがスクロールと更新をサポートしていると仮定すると、結果はどうなるでしょうか?

次のコードフラグメントを考えてみましょう:

データベースがスクロールと更新をサポートしていると仮定すると、結果はどうなるでしょうか?
Correct Answer: D
Fork / Join Frameworkについて正しい2つのステートメントはどれですか? (2つ選択してください。)
Correct Answer: A,C
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
コードの断片を考えると:
Path p1 = Paths.get("/Pics/MyPic.jpeg");
System.out.println (p1.getNameCount() +
":" + p1.getName(1) +
":" + p1.getFileName());
Assume that the Pics directory does NOT exist.
What is the result?
Path p1 = Paths.get("/Pics/MyPic.jpeg");
System.out.println (p1.getNameCount() +
":" + p1.getName(1) +
":" + p1.getFileName());
Assume that the Pics directory does NOT exist.
What is the result?
Correct Answer: C
コードの断片を考えると:
Path source = Paths.get ("/data/december/log.txt");
Path destination = Paths.get("/data");
Files.copy (source, destination);
and assuming that the file /data/december/log.txt is accessible and
contains:
10-Dec-2014 ?Executed successfully
What is the result?
Path source = Paths.get ("/data/december/log.txt");
Path destination = Paths.get("/data");
Files.copy (source, destination);
and assuming that the file /data/december/log.txt is accessible and
contains:
10-Dec-2014 ?Executed successfully
What is the result?
Correct Answer: B
Given:
public interface Moveable<Integer> {
public default void walk (Integer distance)
{System.out.println("Walking");)
public void run(Integer distance);
}
Which statement is true?
public interface Moveable<Integer> {
public default void walk (Integer distance)
{System.out.println("Walking");)
public void run(Integer distance);
}
Which statement is true?
Correct Answer: B