Java - Strings and String Handling
Which statement best describes when to use
StringBuilder instead of String in Java?StringBuilder instead of String in Java?String and StringBuilderString objects are immutable, meaning they cannot be changed once created. Changing text creates new objects, which is slow and uses more memory.StringBuilder is betterStringBuilder allows changing text without creating new objects, making it efficient for many modifications.StringBuilder when you need to change text many times efficiently. -> Option AStringBuilder [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions