final classes

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

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

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

  • Slight performance gain.

Note

Prominent Example: java.lang.String.