How do Java Strings differ from StringBuilder and StringBuffer?

Junior Java

Answer

String is immutable.
StringBuilder is mutable and faster but not thread-safe.
StringBuffer is thread-safe (synchronized).

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice