Loading…
Loading…
Ten exam-style questions on StringBuilder mutability and chaining, counting objects, constructors, append, insert, delete, replace, reverse, setLength, index exceptions and equality, with explanations.
Practice questions for the article Java StringBuilder: Mutability, Chaining and Methods.
The questions follow Java 21 rules, as on the 1Z0-830 exam. Write down the builder's contents after every call, because each change moves the indexes. Aim for at least 8 out of 10 before moving on.
Quiz path: step 21. Take the quizzes in this order, after reading each article.
Previous quiz: String Methods (OCP 21)
Next quiz: String Equality, the String Pool and intern (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.