Re: when & why to make a class final



On Tue, 16 Aug 2005 09:11:55 +0200, Petterson Mikael wrote:

> Hi,
>
> Can anyone explain when and why to make a class final?

If the class somehow intrinsically is critical to behave exactly the way
you specified, including internals like representation of data and so on,
and subclasses would necessarily break this function. (Like
java.lang.Class)

--
You can't run away forever,
But there's nothing wrong with getting a good head start.
--- Jim Steinman, "Rock and Roll Dreams Come Through"


.



Relevant Pages

  • Re: Merging XML
    ... > 1) Assume roots will never be different ... You can't run away forever, ... But there's nothing wrong with getting a good head start. ... Prev by Date: ...
    (comp.lang.java.programmer)
  • Re: Managing a set of boolean flags using bitwise
    ... > Once you understand bit masks, the code is easier to read. ... You can't run away forever, ... But there's nothing wrong with getting a good head start. ... Prev by Date: ...
    (comp.lang.java.programmer)
  • Re: B: 3x roter Tigerlotus
    ... You can't run away forever, ... But there's nothing wrong with getting a good head start. ... Prev by Date: ...
    (de.rec.tiere.aquaristik)
  • Re: NullPointerException: Help needed
    ... You need to check for nulls by means of the == operator. ... You can't run away forever, ... But there's nothing wrong with getting a good head start. ... Prev by Date: ...
    (comp.lang.java.help)
  • Re: make rollback() and throw a exception
    ... > //if a error occurs make the rollback() ... You can't run away forever, ... But there's nothing wrong with getting a good head start. ... Prev by Date: ...
    (comp.lang.java.programmer)