final classes

Figure 478. final classes Slide presentation
public final class Shape { ... }

-------------------------
public class Rectangle
  extends Shape { // Error: final class cannot be extended
...

Figure 479. final classes rationale Slide presentation
  • Design decision.

  • Slight performance gain.

Note

Prominent Example: java.lang.String.