
What Final Does in Java
When you declare a class as final, it can no longer be subclassed. Java has used this for security purposes with classes like String and Integer. It also allows the compiler to make some optimizations. When you declare a method of a class as final, subclasses of the class cannot