|
Problem:
You want to declare that a class may not be subclassed or modified. Solution:
Use the
Discussion: There are circumstances in which you want to declare that the given implementation of a class is "final"; that is, that nothing about the class can be modified by subclasses, and that any attempt to do so should result in an exception. The Note that you can still create an alias to the class, which has the same effect as creating an empty, non-modifiable subclass.
|