The final specifier can be applied to methods and classes.
When a method is marked as final, it cannot be overridden in derived classes.
When a class is marked as final, it cannot be derived from.
Note that final is not a reserved keyword, meaning that you can create variables and types with the name final. Although, in the case of types, that may lead to some confusion.
Compiler Explorer link: https://compiler-explorer.com/z/3afa95Tf6