最新的Oracle Upgrade to Java SE 7 Programmer (1Z1-805日本語版) - 1Z1-805日本語免費考試真題

public class DAOManager {
public AccountDAO getAccountDAO() {
return new AccountJDBCDAO();
}
}

正確答案: B
說明:(僅 Fast2test 成員可見)

String query = "SELECT ID FROM Employee"; \\ Line 1 try (Statement stmt = conn.CreateStatement()) { \\ Line 2 ResultSet rs = stmt.executeQuery(query); \\ Line 3 stmt.executeQuery ("SELECT ID FROM Customer"); \\ Line 4 while (rs.next()) { \\process the results System.out.println ("Employee ID: " + rs.getInt("ID") ); } } catch (Exception e) { system.out.println ("Error"); }

正確答案: C
說明:(僅 Fast2test 成員可見)



正確答案: E
說明:(僅 Fast2test 成員可見)

SimpleDateFormat sdf;

正確答案: B
說明:(僅 Fast2test 成員可見)

正確答案: C
說明:(僅 Fast2test 成員可見)

正確答案: A
說明:(僅 Fast2test 成員可見)

private static void copyContents() {
try (
InputStream fis = new FileInputStream("report1.txt");
OutputStream fos = new FileOutputStream("consolidate.txt");
) {
byte[] buf = new byte[8192];
int i;
while ((i = fis.read(buf)) != -1) {
fos.write(buf, 0, i);
}
fis.close();
fis = new FileInputStream("report2.txt");
while ((i = fis.read(buf)) != -1) {
fos.write(buf, 0, i);
}
}

正確答案: D
說明:(僅 Fast2test 成員可見)

class Fibonacci extends RecursiveTask<Integer> {
final int n;
Fibonacci (int n) { this.n = n }
Integer compute () {
if (n <= 1)
return n;
Fibonacci f1 = new Fibonacci (n - 1);
f1.fork;
Fibonacci f2 = new Fibonacci (n - 2);
return f2.compute() + f1.join; // Line **
}
}
Assume that line ** is replaced with:
return f1.join() + f2.compute(); // Line **

正確答案: C
說明:(僅 Fast2test 成員可見)

正確答案: A
說明:(僅 Fast2test 成員可見)