Question 31 · 52 in bank
Select 2Given:
and

Which two should the module-info file include for it to represent the service provider interface? (Choose two.)
Show answer
Answer: AG
Java SE 17 Developer52 questions across 6 pages are complete and free, with no account or card.
52 questions in this bank
Free access · progress saved on this device
Given:
and

Which two should the module-info file include for it to represent the service provider interface? (Choose two.)
Answer: AG
Given the code fragment:

What is the result?
Answer: A
package q04; import java.time.Instant; import java.time.temporal.ChronoUnit; public class Q04 { public static void main(String[] args) throws InterruptedException { // Login time: 2021-01-12T21:58:18.817Z Instant loginTime = Instant.now(); Thread.sleep(1000); // Logout time: 2021-01-12T21:58:19.880Z Instant logoutTime = Instant.now(); loginTime = loginTime.truncatedTo(ChronoUnit.MINUTES); // line n1 logoutTime = logoutTime.truncatedTo(ChronoUnit.MINUTES); if (logoutTime.isAfter(loginTime)) { System.out.println("Logged out at: " + logoutTime); } else { System.out.println("Can't logout"); } } } // Result: // Can't logout
Source: Adapted from community discussion — james2033
Given the Product class:

and the Shop class:

What is the result?
Answer: B
Given the code fragments:

and:

Which action prints Wagon : 200?
Answer: E
Given:

What is the result?
Answer: D
D is the correct answer. Software is printed from constructor of Software class & Game is printed from the constructor of Game class. new Game("chess",2) these values passed to Game constructor are serialized, then when de-serialized and printed, it prints raw string.
Source: Adapted from community discussion — xplorerpj
Given: Captions.properties file: user = UserName Captions_en.properties file: user = User name (EN) Captions_US.properties file: message = User name (US) Captions_en_US.properties file: message = User name (EN - US) and the code fragment:
What is the result?
Answer: D
Given:
and the code fragment:

Which statement is true?
Answer: D
Given:
Which two modifications enable the code to print Open Close?
Answer: B
B and C correct. A is wrong cuz both Closeable and AutoCloseable are "interfaces", not classes. Therefore, the "implements" keyword must be used. D wrong. the fact that it is "final" and doesnt throw anything is fine, but it is missing the "public" keyword. trying to compile without "public" gives this error: "attempting to assign weaker access privileges; was public"
Source: Adapted from community discussion — supersquax
Given:
and the code fragment:

What is the result?
Answer: D
Given the code fragment:

Which action sorts the book list?
Answer: B
Keyboard:J Kmove between questionsA–Dselect an answerRshow or hide the answer← →change page
1Z0-829 practice, question 31. 52 questions available.
Version 1.0.0. How we source questions