Image

Imageruakh wrote in Imagejava_dev

Final class vs. class with all of its non-private members being final.

Hi all,

Long-time reader, first time poster. :-)

I was wondering: the String class is final, the explanation being that any clients of String need to know that they really have a String, and not some subclass. But what's the advantage of a final class over a class all of whose non-private members are final?

(Technical and OO-theoretical answers are equally welcome.)

Thanks in advance!