Welcome to TestSimulate

Pass Your Next Certification Exam Fast!

Everything you need to prepare, learn & pass your certification exam easily.

365 days free updates. First attempt guaranteed success.

Oracle Java SE 8 Programmer II (1z0-809日本語版) (1z0-809日本語) Free Practice Test

Question 1
Vehicle クラスの定義は次のとおりです。
Class Vehhicle {
int distance;//line n1
Vehicle (int x) {
this distance = x;
}
public void increSpeed(int time) {//line n2
int timeTravel = time;//line n3
class Car {
int value = 0;
public void speed () {
value = distance /timeTravel;
System.out.println ("Velocity with new speed"+value+"kmph");
}
}
new Car().speed();
}
}
and this code fragment:
Vehicle v = new Vehicle (100);
v.increSpeed(60);
結果はどうなりましたか?

Correct Answer: D
Question 2
Given:

and

クラスTxtをリファクタリングするには、java.util.functionpackageのどのインターフェイスを使用する必要がありますか?

Correct Answer: A
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 3
コードの断片を考えると:
Path file = Paths.get ("courses.txt");
// line n1
courses.txtにアクセスできると仮定します。
コードがcourses.txtファイルの内容を印刷できるようにするために、どのコードフラグメントをn1行目に挿入できますか?

Correct Answer: A
Question 4
java.util.stream.Streamについて正しい記述はどれですか?

Correct Answer: C
Question 5
Which code fragment is required to load a JDBC 3.0 driver?

Correct Answer: D
Question 6
コードの断片を考えると:
List<String> colors = Arrays.asList("red", "green", "yellow");
Predicate<String> test = n - > {
System.out.println("Searching...");
return n.contains("red");
};
colors.stream()
.filter(c -> c.length() > 3)
.allMatch(test);
What is the result?

Correct Answer: C
Question 7
Given:
Item table
ID, INTEGER: PK
DESCRIP, VARCHAR(100)
PRICE, REAL
QUANTITY< INTEGER
And given the code fragment:
9. try {
10.Connection conn = DriveManager.getConnection(dbURL, username,
password);
11. String query = "Select * FROM Item WHERE ID = 110";
12. Statement stmt = conn.createStatement();
13. ResultSet rs = stmt.executeQuery(query);
14.while(rs.next()) {
15.System.out.println("ID:" + rs.getInt("Id"));
16.System.out.println("Description:" + rs.getString("Descrip"));
17.System.out.println("Price:" + rs.getDouble("Price"));
18. System.out.println(Quantity:" + rs.getInt("Quantity"));
19.}
20. } catch (SQLException se) {
21. System.out.println("Error");
22. }
Assume that:
- The required database driver is configured in the classpath.
- The appropriate database is accessible with the dbURL, userName, and
passWord exists.
- The SQL query is valid.
What is the result?

Correct Answer: A
Question 8
与えられた:
class Vehicle implements Comparable<Vehicle>{
int vno;
String name;
public Vehicle (int vno, String name) {
this.vno = vno,;
this.name = name;
}
public String toString () {
return vno + ":" + name;
}
public int compareTo(Vehicle o) {
return this.name.compareTo(o.name);
}
and this code fragment:
Set<Vehicle> vehicles = new TreeSet <> ();
vehicles.add(new Vehicle (10123, "Ford"));
vehicles.add(new Vehicle (10124, "BMW"));
System.out.println(vehicles);
結果は何ですか?

Correct Answer: D
Question 9
これらのファイルが存在し、アクセス可能であることを考えると:
/sports/info.txt
/sports/cricket/players.txt
/sports/cricket/data/ODI.txt
and given the code fragment:
int maxDepth =2;
Stream<Path> paths = Files.find(Paths.get("/sports"),
maxDepth,
(p, a) -> p.getFileName().toString().endsWith ("txt"),
FileVisitOption.FOLLOW_LINKS);
Long fCount = paths.count();
System.out.println(fCount);
ディレクトリ構造内のファイルのいずれにもソフトリンク/シンボリックリンクがないと仮定すると、結果はどうなりますか?

Correct Answer: C
Question 10
コードの断片を考えると:

結果は何ですか?

Correct Answer: C
Question 11
与えられた条件:

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

Correct Answer: A
Question 12
次のコードフラグメントを考えてみましょう:

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

Correct Answer: A
Question 13
コードの断片を考えると:
List<String> str = Arrays.asList ("my", "pen", "is", "your', "pen");
Predicate<String> test = s -> {
int i = 0;
boolean result = s.contains ("pen");
System.out.print(i++) + ":");
return result;
};
str.stream()
.filter(test)
.findFirst()
.ifPresent(System.out ::print);
結果は何ですか?

Correct Answer: D