final classes

Figure 476. final classes Slide presentation Create comment in forum
public final class Shape { ... }

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

Figure 477. final classes rationale Slide presentation Create comment in forum
  • Design decision.

  • Slight performance gain.

Note

Prominent Example: java.lang.String.