Oracle Upgrade to Java SE 7 Programmer (1Z1-805日本語版) - 1Z1-805日本語 Exam Practice Test

Question 1

import java.io.*;
public class SampleClass {
public static void main(String[] args) throws IOException {
try {
String dirName = args[0];
File dir = new File(dirName);
File.createTempFile("temp", "log", dir);
} catch (NullPointerException | IOException e) {
e = new IOException("Error while creating temp file");
throw e;
}
}
}

Correct Answer: C
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 2

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 **

Correct Answer: C
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 3

log - Jan2009
log_01_2010
log_Feb2010
log_Feb2011
log-sum-2012

PathMatcher matcher = FileSystems.getDefault ().getPathMatcher ("glob:???_*1");

Correct Answer: B
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 4

Correct Answer: C
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 5

public class CrusherRobot {
public void walk () {}
public void positionArm (int x, int y, int z) {}
public void raiseHammer() {}
public void dropHammer() {}
}
public class GripperRobot {
public void walk() {}
public void moveArm (int x, int y, int z) {}
public void openGripper () {}
public void closeGripper() {}
}

Correct Answer: B
Question 6

SimpleDateFormat sdf;

Correct Answer: C
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).
Question 7

Correct Answer: B
Question 8

Locale loc1 = Locale.getDefault ();
ResourceBundle messages = ResourceBundle.getBundle("MessageBundle", loc1);

Correct Answer: A,D
Question 9

static void addContent () throws Exception {
Path path = Paths.get("D:\\company\\report.txt");
UserPrincipal owner = path.getFileSystem().getUserPrincipalLookupService().lookupPrincipalByName("Bob");
Files.setOwner(path, owner);
// insert code here - Line **
br.write("this is a text message ");
}
System.out.println("success");
}
Assume that the report.txt file exists.

Correct Answer: C
Explanation: Only visible for Actualtests4sure members. You can sign-up / login (it's free).