1z0-819 Practice Test

1z0-819 Practice Test practice questions, page 7 of 9, with answer review and explanations.

Question 31

Given: Path p1 = Paths.get(“/scratch/exam/topsecret/answers”); Path p2 = Paths.get(“/scratch/exam/answers/temp.txt”); Path p3 = Paths.get(“/scratch/answers/topsecret”); Which two statements print ..\..\..\answers\topsecret? (Choose two.)

  1. System.out.print(p3.relativize(p1));
  2. System.out.print(p2.relativize(p3));
  3. System.out.print(p1.relativize(p3));
  4. System.out.print(p3.relativize(p2));
  5. System.out.print(p1.relativize(p2));
  6. System.out.print(p2.relativize(p1));

Question 32

Given the code fragment: Which fields are serialized in a Student object?

  1. studentNo and classes
  2. studentNo and name
  3. studentNo, classes and name
  4. studentNo, classes, name, and address

Question 33

Given: What is the output?

  1. banana orange apple lemon ----- apple banana lemon orange -----
  2. ----- banana orange apple lemon ----- apple banana lemon orange
  3. ----- -----
  4. ----- ----- banana orange apple lemon apple banana lemon orange
  5. banana orange apple lemon apple banana lemon orange ----- -----

Question 34

and What is the output?

  1. Bonjour le monde! Bonjour le monde!
  2. Hello world! Hello world!
  3. Hello world! Bonjour le monde!
  4. Bonjour le monde! Hello world!

Question 35

Given: What is true?

  1. A NoSuchElementException is thrown at run time.
  2. The compilation fails.
  3. This should print the same result each time the program runs.
  4. This may not print the same result each time the program runs.