← All topics
Quiz: Java Strings: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. What does this print? (code)
- Q2. What does this print? (code)
- Q3. Which is the fastest choice to build a long string in a single-threaded loop?
- Q4. Why are Java Strings immutable? (pick the best reason)
- Q5. What does this print? (code)
- Q6. What does this print? (code)
- Q7. What does this print? (code)
- Q8. You need a changeable string that several threads modify at the same time. Which class fits?
- Q9. What does this print? (code)
- Q10. What does "Java".equals(name) do better than name.equals("Java")?