Why Integer Class in Final in Java ?

Integer class is a wrapper for int. If it is not marked final, then any other class can extend it and modify the behavior of Integer operations. To avoid this Integer wrapper class is marked as final.



You May Interest

What are the Rules of Method Overloading and Method Overriding in ...

How Can We Find the Memory Usage of JVM From Java Code ?

Why an Object Used as Key in HashMap Should Be Immutable in Java ...

Why Should You Define a Default Constructor in Java ?

How Can You Make an Object Eligible for Garbage Collection in Jav ...