In the past couple of months, I had a lot of discussion with people over immutable
classes. From novice to experts, from beginners to leads, they were all. You utter the term
Immutable Classes in front of any Java/.NET professional and the immediate response would be
String class showing his command over the subject. But is that the only thing that relates to
Immutability. I guess there is more. If we talk of Java only, there are so many other
classes from the JDK itself, which exhibit this behavior. Surprised - Don’t be! All primitive
wrapper classes such as
Integer, Double, Float, Boolean, Short, Byte etc. are immutable objects.
Read the full post here.