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

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: D
Question 2

public static void getInfo() {
//insert code here
List fontCatalog = new ArrayList();
fontCatalog.add("Algerian");
fontCatalog.add("Cambria");
fontCatalog.add("Lucida Bright");
category.put("firstCategory",fontCatalog);
List entrySet = new ArrayList(category.entrySet());
Iterator it = entrySet.iterator();
while(it.hasNext()) {
System.out.println(it.next));
}
}

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

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

public class DataCache {
private static final DataCache instance = new DataCache ();
public static DataCache getInstance () {
return instance;
}
}

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

public class TemperatureSensor {
public TemperatureSensor () {
}
public double getCurrTemp () {
// . . . method to retrieve temperature from a sensor
Return temp;
}
}

Correct Answer: B,C,E
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 6

public static void main (String [] args) {
Path path1 = Paths.get("D:\\sys\\asm\\.\\data\\..\\..\\mfg\\production.log");
System.out.println(path1.normalize());
System.out.println(path1.getNameCount());
}
}

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

public class MyGrades {
private final List<Integer> myGrades = new ArrayList<Integer>();
private final ReadWriteLock rwlock = new ReentrantReadWriteLock();
public void addGrade(Integer grade) {
// acquire _______ lock
myGrades.add(grade);
// release __________ lock
}
public void averageGrades() {
// acquire _______ lock Line ** double sum = 0;
int i = 0;
for (i = 0; i < myGrades.size(); i++) {
sum += myGrades.get(i);
}
// release __________ lock Line ***
System.out.println("The average is: " + sum/(i+1));
}
}

Correct Answer: E
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 8

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

List<Person> pList = new CopyOnWriteArrayList<Person>();

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