To prevent overrides or subclassing, we can use the final keyword. To use the final keyword, we add it before the item's definition. Examples are final func, final var, and final class.
Any attempt to override an item marked with this keyword will result in a compile-time error.