2017  Kodetalk | Feedback | Privacy Policy | Terms | About
userimage

Why String is final in Java

Why String is final in Java
userimage

String is final because of same reason it is immutable [ mutable objects have fields that can be changed, immutable objects have no fields that can be changed after the object is created]. Some other reasons like implementation of String pool, Security, and Performance. Java designers knows that String will be used heavily in every single Java program, so they optimized it from the start.

Answer is