최신Oracle Upgrade to Java SE 7 Programmer (1Z0-805日本語版) - 1Z0-805日本語무료샘플문제

/* method declaration */ { try {
String className = "java.lang.String";
String fieldname = "somefield";
Class c = Class.forName(className);
Field f = c.getField(fieldname);
} catch(Exception e) {
e.printStackTrace();
throw e;
}
}





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


class MyTask extends RecursiveTask<Integer> {
final int low;
final int high;
static final int THRESHOLD = /* . . . */
MyTask (int low, int high) { this.low = low; this.high = high; }
Integer computeDirectly()/* . . . */
protected void compute() {
if (high - low <= THRESHOLD)
return computeDirectly();
int mid = (low + high) / 2;
invokeAll(new MyTask(low, mid), new MyTask(mid, high));


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


Path path1 = Paths.get("D:\\sales\\.\\quarterly\\..\\report");
path1 = path1.normalize();
Path path2 = path1.relativize(Paths.get("d:\\empdetails.dat"));
path2 = path2.resolve(path1);
System.out.println(path1);
System.out.println(path2);
}


try {
String query = "SELECT * FROM Item";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(query);
ResultSetMetaData rsmd = rs.getMetaData();
int rowCount = rsmd.getRowCount();
System.out.println ("Processing: " + rowCount + " rows.");
while (rs.next()) {
// Process each row
}
} catch (SQLException se) {
System.out.println("Error");
}
