📅  最后修改于: 2022-03-11 15:00:22.528000             🧑  作者: Mango
String vs StringBuilder vs StringBuffer:
String: Immutable version char sequences
StringBuilder: mutable version char sequences,
not synchronized
StringBuffer: mutable version char sequences,
synchronized , thread-safe, slow
String str = new String("a")
StringBuilder s2 = new StringBuilder("B") // MUTABLE
StringBuffer s2 = new StringBuffer("c") // Synchronized