How does String memory allocation work in Java? Why are Strings immutable, and what is the difference between String, StringBuilder, and StringBuffer?