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

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
說明:(僅 VCESoft 成員可見)
問題2

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

正確答案: B,D,E
說明:(僅 VCESoft 成員可見)
問題3

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() {}
}

正確答案: A
問題4

正確答案: D
說明:(僅 VCESoft 成員可見)
問題5

public static void main(String[] args) {
String source = "d:\\company\\info.txt";
String dest = "d:\\company\\emp\\info.txt";
//insert code fragment here Line **
} catch (IOException e) {
System.err.println ("Caught IOException: " + e.getmessage();
}
}

正確答案: C,D
問題6

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;
}
}
}

正確答案: D
說明:(僅 VCESoft 成員可見)
問題7

public static void main(String[] args) {
Path file = Paths.get("D:\\company\\report.txt");
try (SeekableByteChannel sbc = Files.newByteChannel(file,new OpenOption[]
sbc.position(5);
sbc.truncate(30);
} catch (IOException e) {
System.err.printin("Caught IOException: " + e.getMessage () } ;
}
}

正確答案: C
說明:(僅 VCESoft 成員可見)
問題8

Person
public Person(int id)
public int getid()
public String getContactDetails()
public void setContactDetails(String contactDetails) public String getName()
public void setName(String name)
public Person getPerson(int id) throws Exception
public void createPerson(int id) throws Exception
public Person deletePerson(int id) throws Exception
public void updatePerson(Person p) throws Exception

正確答案: C
說明:(僅 VCESoft 成員可見)
問題9

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

