Module 9: Advanced Core Features
StringBuilder vs StringBuffer
Pick the correct mutable string class for single-threaded or synchronized scenarios.
StringBuilder is unsynchronized and ideal for local operations.
StringBuffer synchronizes methods and may be necessary when multiple threads share an instance.
Prefer returning immutable Strings from APIs even if constructed with builders internally.