Loading…
Loading…
Ten exam-style questions on == versus equals, string literals and the string pool, compile-time constants and final variables, runtime concatenation, new String, intern(), and equality for StringBuilder, arrays and records, with explanations.
Practice questions for the article Java String Equality: ==, equals, the String Pool and intern.
The questions follow Java 21 rules, as on the 1Z0-830 exam. Label every string as pooled (a literal, a constant expression or an intern() result) or runtime, then compare. Aim for at least 8 out of 10 before moving on.
Quiz path: step 22. Take the quizzes in this order, after reading each article.
Previous quiz: StringBuilder (OCP 21)
10 questions · pass at 68%
Check your understanding; you see the answers and explanations after submitting.
Discussion
Sign in to ask a question or share what you learned.