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

When Will You Use Strategy Design Pattern in Java ?

How Can We Prevent Busy Waiting in Java ?

What are the Similarities Between HashSet and HashMap in Java ?

What are the Different States of a Thread in Java ?

What is the Different Type of Tag Library Groups in JSTL ?