1z0-809日本語試験無料問題集「Oracle Java SE 8 Programmer II (1z0-809日本語版) 認定」

Given the code fragment:
9. Connection conn = DriveManager.getConnection(dbURL, userName,
passWord);
10. String query = "SELECT id FROM Employee";
11. try (Statement stmt = conn.createStatement()) {
12. ResultSet rs = stmt.executeQuery(query);
13.stmt.executeQuery("SELECT id FROM Customer");
14. while (rs.next()) {
15. //process the results
16.System.out.println("Employee ID: "+ rs.getInt("id"));
17.}
18. } catch (Exception e) {
19. System.out.println ("Error");
20. }
と仮定する:
-必要なデータベースドライバーがクラスパスで構成されています。
-適切なデータベースには、dbURL、userName、および
passWordが存在します。
-EmployeeテーブルとCustomerテーブルが使用可能であり、各テーブルにはIDがあります
いくつかのレコードとSQ​​Lクエリを含む列は有効です。
このコードフラグメントをコンパイルして実行した結果はどうなりますか?

コードの断片を考えると:
List<Integer> codes = Arrays.asList (10, 20);
UnaryOperator<Double> uo = s -> s +10.0;
codes.replaceAll(uo);
codes.forEach(c -> System.out.println(c));
結果は何ですか?

コードの断片を考えると:
List<Integer> list1 = Arrays.asList(10, 20);
List<Integer> list2 = Arrays.asList(15, 30);
//line n1
Which code fragment, when inserted at line n1, prints 10 20 15 30?

アプリケーションのローカライズに関して当てはまる2つのステートメントはどれですか?

解説: (GoShiken メンバーにのみ表示されます)
Given:
class CheckClass {
public static int checkValue (String s1, String s2) {
return s1 length() ?s2.length();
}
}
and the code fragment:
String[] strArray = new String [] {"Tiger", "Rat", "Cat", "Lion"}
//line n1
for (String s : strArray) {
System.out.print (s + " ");
}
Which code fragment should be inserted at line n1 to enable the code to print Rat Cat Lion Tiger?

コードの断片を考えると:
class Employee {
Optional<Address> address;
Employee (Optional<Address> address) {
this.address = address;
}
public Optional<Address> getAddress() { return address; }
}
class Address {
String city = "New York";
public String getCity { return city: }
public String toString() {
return city;
}
}
and
Address address = new Address;
Optional<Address> addrs1 = Optional.ofNullable (address);
Employee e1 = new Employee (addrs1);
String eAddress = (addrs1.isPresent()) ? addrs1.get().getCity() : "City Not available"; System.out.println(eAddress); 結果は何ですか?

コードの断片を考えると:
class MyThread implements Runnable {
private static AtomicInteger count = new AtomicInteger (0);
public void run () {
int x = count.incrementAndGet();
System.out.print (x+" ");
}
}
and
Thread thread1 = new Thread(new MyThread());
Thread thread2 = new Thread(new MyThread());
Thread thread3 = new Thread(new MyThread());
Thread [] ta = {thread1, thread2, thread3};
for (int x= 0; x < 3; x++) {
ta[x].start();
}
Which statement is true?

コンテンツを考えると:

そして、コードの断片が与えられた:

どの2つのコードフラグメントが、行1に独立して挿入されたときに、コードの印刷を可能にしますか
"Wie geht's?"

コードの断片を考えると:
UnaryOperator<Integer> uo1 = s -> s*2;line n1
List<Double> loanValues = Arrays.asList(1000.0, 2000.0);
loanValues.stream()
.filter(lv -> lv >= 1500)
.map(lv -> uo1.apply(lv))
.forEach(s -> System.out.print(s + " "));
What is the result?

The data.doc, data.txt and data.xml files are accessible and contain text.
Given the code fragment:
Stream<Path> paths = Stream.of (Paths. get("data.doc"),
Paths. get("data.txt"),
Paths. get("data.xml"));
paths.filter(s-> s.toString().endWith("txt")).forEach(
s -> {
try {
Files.readAllLines(s)
.stream()
.forEach(System.out::println); //line n1
} catch (IOException e) {
System.out.println("Exception"); }
}
);
結果は何ですか?

STUDENTtableのレコードを考えると:

コードの断片を考えると:

Assume that the URL, username,and passwordare valid.
What is the result?

与えられた:
class Student {
String course, name, city;
public Student (String name, String course, String city) {
this.course = course; this.name = name; this.city = city;
}
public String toString() {
return course + ":" + name + ":" + city;
}
public String getCourse() {return course;}
public String getName() {return name;}
public String getCity() {return city;}
and the code fragment:
List<Student> stds = Arrays.asList(
new Student ("Jessy", "Java ME", "Chicago"),
new Student ("Helen", "Java EE", "Houston"),
new Student ("Mark", "Java ME", "Chicago"));
stds.stream()
.collect(Collectors.groupingBy(Student::getCourse))
.forEach(src, res) -> System.out.println(res));
結果は何ですか?

コードの断片を考えると:
class TechName {
String techName;
TechName (String techName) {
this.techName=techName;
}
}
and
List<TechName> tech = Arrays.asList (
new TechName("Java-"),
new TechName("Oracle DB-"),
new TechName("J2EE-")
);
Stream<TechName> stre = tech.stream();
//line n1
Which should be inserted at line n1 to print Java-Oracle DB-J2EE-?

与えられた条件:

関数インターフェースを使用してリファクタリングされたコードはどれですか?

コードの断片を考えると:

Course enumの有効な定義はどれですか?

与えられた:

and the code fragment:

スレッドt1とt2は非同期に実行され、ABCAまたはAACBを出力する可能性があります。
スレッドを同期的に実行してABCを出力するようにコードを変更するように求められました。
どの修正が要件を満たしていますか?

コードの断片を考えると:

結果は何ですか?

コードの断片を考えると:
public class Foo {
public static void main (String [ ] args) {
Map<Integer, String> unsortMap = new HashMap< > ( );
unsortMap.put (10, "z");
unsortMap.put (5, "b");
unsortMap.put (1, "d");
unsortMap.put (7, "e");
unsortMap.put (50, "j");
Map<Integer, String> treeMap = new TreeMap <Integer, String> (new
Comparator<Integer> ( ) {
@Override public int compare (Integer o1, Integer o2) {return o2.compareTo (o2); } } ); treeMap.putAll (unsortMap); for (Map.Entry<Integer, String> entry : treeMap.entrySet () ) { System.out.print (entry.getValue () + " ");
}
}
}
結果は何ですか?