Question: 1. what is the difference between the string class and the stringbuilder class?
Answer: String is immutable whereas StringBuffer and StringBuilder are mutable classes. StringBuffer is thread-safe and synchronized whereas StringBuilder is not.