NOTE

final

Final has different meanings on classes, methods, and variables. These notes record inheritance, overriding, and assignment restrictions.

JavaCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. Usage

  • Applied to a class: means the class cannot be subclassed.
  • Applied to a method: means the method cannot be overridden.
  • Applied to a variable: means the variable can be assigned only once and its value cannot be changed afterward (a constant).

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub