As far as creating your own class with an immutable object, I'm not sure if
there's a way to lock a class member variable after it's been initialized by the
constructor other than to keep it private and not provide any methods to change
the value.
Immutable objects are generally useful if you want data that can't be changed
when passed into a function. For instance, if you have a regular mutable object
that's passed into a function, the function can alter that object before it
finishes. There's really nothing particularly exciting about the concept from a
programmer's perspective, but it's probably really useful if you're designing a
language and need object wrappers for primitive types.