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.)
- System.out.print(p3.relativize(p1));
- System.out.print(p2.relativize(p3));
- System.out.print(p1.relativize(p3));
- System.out.print(p3.relativize(p2));
- System.out.print(p1.relativize(p2));
- System.out.print(p2.relativize(p1));
Question 32
Given the code fragment: Which fields are serialized in a Student object?
- studentNo and classes
- studentNo and name
- studentNo, classes and name
- studentNo, classes, name, and address
Question 33
Given: What is the output?
- banana orange apple lemon ----- apple banana lemon orange -----
- ----- banana orange apple lemon ----- apple banana lemon orange
- ----- -----
- ----- ----- banana orange apple lemon apple banana lemon orange
- banana orange apple lemon apple banana lemon orange ----- -----
Question 34
and What is the output?
- Bonjour le monde! Bonjour le monde!
- Hello world! Hello world!
- Hello world! Bonjour le monde!
- Bonjour le monde! Hello world!
Question 35
Given: What is true?
- A NoSuchElementException is thrown at run time.
- The compilation fails.
- This should print the same result each time the program runs.
- This may not print the same result each time the program runs.