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

Enumeration and Iterator, Which One Has Better Performance in Jav ...

How HashMap Works in Java ?

What is the Difference Between a Nested Class and an Inner Class ...

Why We Cannot Create a Generic Array in Java ?

When Does JVM Call the Finalize Method in Java ?