Oracle Java SE 8 Programmer II (1z0-809日本語版) - 1z0-809日本語 Exam Practice Test

Question 1
Given:

どのオプションが失敗しますか?

Correct Answer: A
Question 2
コードの断片を考えると:
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
Question 3
employee.txtファイルの内容を考えると:
すべての労働者はマスターです。
employee.txtファイルがアクセス可能であり、ファイルallemp.txtが存在しないこと、およびコードの断片を考えると:

結果は何ですか?

Correct Answer: B
Question 4
コードの断片を考えると:

結果は何ですか?

Correct Answer: A
Question 5
STUDENTテーブルの構造を考えます:
学生(id INTEGER、name VARCHAR)
与えられた:
public class Test {
static Connection newConnection =null;
public static Connection get DBConnection () throws SQLException {
try (Connection con = DriveManager.getConnection(URL, username, password)) { newConnection = con;
}
return newConnection;
}
public static void main (String [] args) throws SQLException {
get DBConnection ();
Statement st = newConnection.createStatement();
st.executeUpdate("INSERT INTO student VALUES (102, 'Kelvin')");
}
}
と仮定する:
必要なデータベースドライバーは、クラスパスで構成されます。
適切なデータベースにアクセスするには、URL、userName、およびpassWordを使用します。
SQLクエリは有効です。
結果は何ですか?

Correct Answer: B
Question 6
コードの断片を考えると:

行n1に個別に挿入した場合、どの2つのコードフラグメントが出力PEEKになりますか。
Unix?

Correct Answer: A,C
Question 7
コードの断片を考えると:
public class Foo {
public static void main (String [ ] args) {
Map<Integer, String> unsortMap = new HashMap< > ( );
unsortMap.put (10, "z");
unsortMap.put (5, "b");
unsortMap.put (1, "d");
unsortMap.put (7, "e");
unsortMap.put (50, "j");
Map<Integer, String> treeMap = new TreeMap <Integer, String> (new
Comparator<Integer> ( ) {
@Override public int compare (Integer o1, Integer o2) {return
o2.compareTo
(o1); } } );
treeMap.putAll (unsortMap);
for (Map.Entry<Integer, String> entry : treeMap.entrySet () ) {
System.out.print (entry.getValue () + " ");
}
}
}
What is the result?

Correct Answer: B
Question 8
コードの断片を考えると:
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: C
Question 9
Given:

結果は何ですか?

Correct Answer: B