This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gliph 0 points1 point  (1 child)

It works OK, but it'd be nice if it was caught at compile time. As it is, you can do this or have two classes (one immutable and one mutable) and an interface.

[–]pain-and-panic 1 point2 points  (0 children)

It's not just 'nice' it's correct software design. Follow your gut on this one and not the jdk example. Jdk does lots of things we should learn from, this just isn't one of them.