✏️ Explanatory Question

Why is String class considered immutable?

👁 814 Views
📘 Detailed Answer
💡

Answer with Explanation

The String class is immutable, so that once it is created a String object cannot be changed. Since String is immutable it can safely be shared between many threads ,which is considered very important for multithreaded programming.