1z0-809 試験問題 101
Given that data.txt and alldata.txt are accessible, and the code fragment:

What is required at line n1 to enable the code to overwrite alldata.txt with data.txt?

What is required at line n1 to enable the code to overwrite alldata.txt with data.txt?
1z0-809 試験問題 102
次のコードフラグメントがあるとします:

結果はどうなりましたか?

結果はどうなりましたか?
1z0-809 試験問題 103
次のコードフラグメントがあるとします:
List<String> str = Arrays.asList ("my", "pen", "is", "your', "pen"); Predicate<String> test = s -> {
整数 i = 0;
ブール値の結果 = s.contains("pen");
System.out.print(i++) + ":");
結果を返します。
};
str.stream()
.filter(テスト)
.findFirst()
.ifPresent(System.out ::print);
結果はどうなりましたか?
List<String> str = Arrays.asList ("my", "pen", "is", "your', "pen"); Predicate<String> test = s -> {
整数 i = 0;
ブール値の結果 = s.contains("pen");
System.out.print(i++) + ":");
結果を返します。
};
str.stream()
.filter(テスト)
.findFirst()
.ifPresent(System.out ::print);
結果はどうなりましたか?
1z0-809 試験問題 104
Given the structure of the STUDENT table:
Student (id INTEGER, name VARCHAR)
Given:
public class Test {
static Connection newConnection =null;
public static Connection get DBConnection () throws SQLException {
try (Connection con = DriveManager.getConnection(URL, username, password)) {
newConnection = con;
}
return newConnection;
}
public static void main (String [] args) throws SQLException {
get DBConnection ();
Statement st = newConnection.createStatement();
st.executeUpdate("INSERT INTO student VALUES (102, 'Kelvin')");
}
}
Assume that:
The required database driver is configured in the classpath.
The appropriate database is accessible with the URL, userName, and passWord exists.
The SQL query is valid.
What is the result?
Student (id INTEGER, name VARCHAR)
Given:
public class Test {
static Connection newConnection =null;
public static Connection get DBConnection () throws SQLException {
try (Connection con = DriveManager.getConnection(URL, username, password)) {
newConnection = con;
}
return newConnection;
}
public static void main (String [] args) throws SQLException {
get DBConnection ();
Statement st = newConnection.createStatement();
st.executeUpdate("INSERT INTO student VALUES (102, 'Kelvin')");
}
}
Assume that:
The required database driver is configured in the classpath.
The appropriate database is accessible with the URL, userName, and passWord exists.
The SQL query is valid.
What is the result?
1z0-809 試験問題 105
Given the code fragments:
class Caller implements Callable<String> {
String str;
public Caller (String s) {this.str=s;}
public String call()throws Exception { return str.concat ("Caller");}
}
class Runner implements Runnable {
String str;
public Runner (String s) {this.str=s;}
public void run () { System.out.println (str.concat ("Runner"));}
}
and
public static void main (String[] args) InterruptedException, ExecutionException { ExecutorService es = Executors.newFixedThreadPool(2); Future f1 = es.submit (new Caller ("Call")); Future f2 = es.submit (new Runner ("Run")); String str1 = (String) f1.get(); String str2 = (String) f2.get();//line n1 System.out.println(str1+ ":" + str2);
}
What is the result?
class Caller implements Callable<String> {
String str;
public Caller (String s) {this.str=s;}
public String call()throws Exception { return str.concat ("Caller");}
}
class Runner implements Runnable {
String str;
public Runner (String s) {this.str=s;}
public void run () { System.out.println (str.concat ("Runner"));}
}
and
public static void main (String[] args) InterruptedException, ExecutionException { ExecutorService es = Executors.newFixedThreadPool(2); Future f1 = es.submit (new Caller ("Call")); Future f2 = es.submit (new Runner ("Run")); String str1 = (String) f1.get(); String str2 = (String) f2.get();//line n1 System.out.println(str1+ ":" + str2);
}
What is the result?
