[Q72-Q95] 究極のガイド準備問題1z0-809には正確なPDF解答[2022年03月05日]

Share

究極のガイド準備問題1z0-809には正確なPDF解答[2022年03月05日]

合格できるOracleの試験問題集

質問 72
Given:
public class Test<T> {
private T t;
public T get () {
return t;
}
public void set (T t) {
this.t = t;
}
public static void main (String args [ ] ) {
Test<String> type = new Test<>();
Test type 1 = new Test ();//line n1
type.set("Java");
type1.set(100);//line n2
System.out.print(type.get() + " " + type1.get());
}
}
What is the result?

  • A. java.lang.string@<hashcode>java.lang.Integer@<hashcode>
  • B. A compilation error occurs. To rectify it, replace line n1 with:Test<Integer> type1 = new Test<>();
  • C. Java 100
  • D. A compilation error occurs. To rectify it, replace line n2 with:type1.set (Integer(100));

正解: C

 

質問 73
Given the code fragment:
List<Integer> codes = Arrays.asList (10, 20);
UnaryOperator<Double> uo = s -> s +10.0;
codes.replaceAll(uo);
codes.forEach(c -> System.out.println(c));
What is the result?

  • A. 20.0
    30.0
  • B. A compilation error occurs.
  • C. 10
    20
  • D. A NumberFormatException is thrown at run time.

正解: A

 

質問 74
Given:

From what threading problem does the program suffer?

  • A. livelock
  • B. race condition
  • C. starvation
  • D. deadlock

正解: D

 

質問 75
Given:

What is the result?

  • A. 1 3 5 7 9
  • B. 2 4 6 8
  • C. 2 4 6 8 9
  • D. 1 3 5 7

正解: B

 

質問 76
Given the code fragment:
ZonedDateTime depart = ZonedDateTime.of(2015, 1, 15, 3, 0, 0, 0, ZoneID.of("UTC-
7"));
ZonedDateTime arrive = ZonedDateTime.of(2015, 1, 15, 9, 0, 0, 0, ZoneID.of("UTC-
5"));
long hrs = ChronoUnit.HOURS.between(depart, arrive); //line n1
System.out.println("Travel time is" + hrs + "hours");
What is the result?

  • A. Travel time is 4 hours
  • B. An exception is thrown at line n1.
  • C. Travel time is 8 hours
  • D. Travel time is 6 hours

正解: A

 

質問 77
Given:

and the code fragment:

What is the result?

  • A. [Java EE: Helen:Houston]
    [Java ME: Jessy:Chicago, Java ME: Mark:Chicago]
  • B. Java EE
    Java ME
  • C. A compilation error occurs.
  • D. [Java ME: Jessy:Chicago, Java ME: Mark:Chicago]
    [Java EE: Helen:Houston]

正解: C

 

質問 78
Given the code fragment:
List<Integer> nums = Arrays.asList (10, 20, 8):
System.out.println (
//line n1
);
Which code fragment must be inserted at line n1to enable the code to print the maximum number in
the numslist?

  • A. nums.stream().map(a -> a).max()
  • B. nums.stream().max(Integer : : max).get()
  • C. nums.stream().max()
  • D. nums.stream().max(Comparator.comparing(a -> a)).get()

正解: D

 

質問 79
Given:
1.abstract class Shape {
2.Shape ( ) { System.out.println ("Shape"); }
3.protected void area ( ) { System.out.println ("Shape"); }
4.}
5.6.
class Square extends Shape {
7.int side;
8.Square int side { 9./* insert code here */
10.
this.side = side;
11.
}
12.
public void area ( ) { System.out.println ("Square"); }
13.
}
14.
class Rectangle extends Square {
15.
int len, br;
16.
Rectangle (int x, int y) {
17.
/* insert code here */
18.
len = x, br = y;
19.
}
20.
void area ( ) { System.out.println ("Rectangle"); }
21.
}
Which two modifications enable the code to compile?

  • A. At line 9, insert super ( );
  • B. At line 20, use public void area ( ) {
  • C. At line 12, remove public
  • D. At line 17, insert super (); super.side = x;
  • E. At line 1, remove abstract
  • F. At line 17, insert super (x);

正解: C,F

 

質問 80
Given:

What is the result?
Bar Hello

  • A.
  • B. A compilation error occurs in the Dazeclass.
  • C. Foo Hello
    Bar Hello
  • D. Baz Hello
    Baz Hello

正解: A

 

質問 81
Which three statements are benefits of encapsulation?

  • A. Prevents code from causing exceptions
  • B. Enables the class implementation to protect its invariants
  • C. Enables multiple instances of the same class to be created safely
  • D. Protects confidential data from leaking out of the objects
  • E. Allows a class implementation to change without changing t he clients
  • F. Permits classes to be combined into the same package

正解: B,D,E

 

質問 82
Which two class definitions fail to compile?

  • A. Option E
  • B. Option B
  • C. Option C
  • D. Option D
  • E. Option A

正解: B,C

 

質問 83
Given the code fragment:
Path file = Paths.get ("courses.txt");
// line n1
Assume the courses.txtis accessible.
Which code fragment can be inserted at line n1to enable the code to print the content of the courses.txtfile?

  • A. Stream<String> fc = Files.readAllLines (file);
    fc.forEach (s - > System.out.println(s));
  • B. Stream<String> fc = Files.lines (file);
    fc.forEach (s - > System.out.println(s));
  • C. List<String> fc = Files.list(file);
    fc.stream().forEach (s - > System.out.println(s));
  • D. List<String> fc = readAllLines(file);
    fc.stream().forEach (s - > System.out.println(s));

正解: A

 

質問 84
Given the code fragments:
4. void doStuff() throws ArithmeticException, NumberFormatException, Exception {
5. if (Math.random() >-1 throw new Exception ("Try again");
6. }
and
24. try {
25. doStuff ( ):
26. } catch (ArithmeticException | NumberFormatException | Exception e) {
27. System.out.println (e.getMessage()); }
28. catch (Exception e) {
29. System.out.println (e.getMessage()); }
30. }
Which modification enables the code to print Try again?

  • A. Comment the lines 28, 29 and 30.
  • B. Replace line 27 with:throw e;
  • C. Replace line 26 with:} catch (Exception | ArithmeticException | NumberFormatException e) {
  • D. Replace line 26 with:} catch (ArithmeticException | NumberFormatException e) {

正解: D

 

質問 85
Given:

Which option fails?

  • A. Foo<Object, Object> percentage = new Foo<String, Integer>("Steve", 100);
  • B. Foo<String, String> grade = new Foo <> ("John", "A");
  • C. Foo<String, String> pair = Foo.<String>twice ("Hello World!");
  • D. Foo<String, Integer> mark = new Foo<String, Integer> ("Steve", 100);

正解: D

 

質問 86
Given:
class UserException extends Exception { }
class AgeOutOfLimitException extends UserException { }
and the code fragment:
class App {
public void doRegister(String name, int age)
throws UserException, AgeOutOfLimitException {
if (name.length () <= 60) {
throw new UserException ();
} else if (age > 60) {
throw new AgeOutOfLimitException ();
} else {
System.out.println("User is registered.");
}
}
public static void main(String[ ] args) throws UserException {
App t = new App ();
t.doRegister("Mathew", 60);
}
}
What is the result?

  • A. An AgeOutOfLimitException is thrown.
  • B. A compilation error occurs in the main method.
  • C. A UserException is thrown.
  • D. User is registered.

正解: C

 

質問 87
Given the code fragment:

What is the result?

  • A. Java EEJava SE
  • B. Java EEJava EESE
  • C. Java EESE
  • D. The program prints either:
    Java EEJava SE
    or
    Java SEJava EE

正解: A

 

質問 88
Given records from the Player table:

and given the code fragment:
try {
Connection conn = DriverManager.getConnection(URL, username, password); Statement st= conn.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); st.execute ("SELECT * FROM Player"); st.setMaxRows(2); ResultSet rs = st.getResultSet(); rs.absolute(3); while (rs.next ()) { System.out.println(rs.getInt(1) + " " + rs.getString(2));
}
} catch (SQLException ex) {
System.out.print("SQLException is thrown.");
}
Assume that:
The required database driver is configured in the classpath.
The appropriate database is accessible with URL, username, and password.
The SQL query is valid.
What is the result?

  • A. The program prints nothing.
  • B. SQLException is thrown.
  • C. 3 Sam
  • D. 2 Jack3 Sam

正解: B

 

質問 89
Given the code fragment:

Which should be inserted into line n1 to print Average = 2.5?

  • A. Stream str = Stream.of (1, 2, 3, 4);
  • B. IntStream str = Stream.of (1, 2, 3, 4);
  • C. DoubleStream str = Stream.of (1.0, 2.0, 3.0, 4.0);
  • D. IntStream str = IntStream.of (1, 2, 3, 4);

正解: C

 

質問 90
Given:

and the code fragment:

What is the result?

  • A. A compilation error occurs because the try block is declared without a catch or finally block.
  • B. An exception is thrown at line n2.
  • C. A compilation error occurs at line n1.
  • D. 0

正解: C

 

質問 91
Given the records from the Employeetable:

and given the code fragment:
try {
Connection conn = DriverManager.getConnection (URL, userName, passWord); Statement st = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
st.execute("SELECT*FROM Employee");
ResultSet rs = st.getResultSet();
while (rs.next()) {
if (rs.getInt(1) ==112) {
rs.updateString(2, "Jack");
}
}
rs.absolute(2);
System.out.println(rs.getInt(1) + " " + rs.getString(2));
} catch (SQLException ex) {
System.out.println("Exception is raised");
}
Assume that:
The required database driver is configured in the classpath.
The appropriate database accessible with the URL, userName, and passWordexists.
What is the result?

  • A. The program prints Exception is raised.
  • B. The Employee table is updated with the row:
    1 12 Jack
    and the program prints:
    1 12 Jerry
  • C. The Employee table is not updated and the program prints:
    1 12 Jerry
  • D. The Employee table is updated with the row:
    1 12 Jack
    and the program prints:
    1 12 Jack

正解: A

 

質問 92
What is the proper way to defined a method that take two int values and returns their sum as an int value?

  • A. void sum (int first, int second) { return first + second; }
  • B. int sum(int first, int second) { first + second; }
  • C. sum(int first, int second) { return first + second; }
  • D. int sum(int first, int second) { return first + second; }
  • E. int sum(int first, second) { return first + second; }

正解: D

 

質問 93
Given the code fragment:
Path file = Paths.get ("courses.txt");
// line n1
Assume the courses.txt is accessible.
Which code fragment can be inserted at line n1 to enable the code to print the content of the courses.txt file?

  • A. List<String> fc = Files.list(file);fc.stream().forEach (s - > System.out.println(s));
  • B. List<String> fc = readAllLines(file);fc.stream().forEach (s - > System.out.println(s));
  • C. Stream<String> fc = Files.readAllLines (file);fc.forEach (s - > System.out.println(s));
  • D. Stream<String> fc = Files.lines (file);fc.forEach (s - > System.out.println(s));

正解: D

 

質問 94
Given:

and the code fragment:

What is the result?

  • A. 0
  • B. A compilation error occurs at line n1.
  • C. 1
  • D. An Exceptionis thrown at run time.

正解: B

 

質問 95
......

最新1z0-809試験問題集で有効で最新の問題集:https://www.goshiken.com/Oracle/1z0-809-mondaishu.html

完全版で最新の1z0-809問題集で100%カバー率問題と解答があなたをリアル試験で合格させる:https://drive.google.com/open?id=1I0Lij0z12u_Z4eZZ9MGznrbQE4maqrLU