Describe String intern() methodology

devquora
devquora

Posted On: Feb 22, 2018

 

As indicated by Oracle records, when the intern methodology is summoned, if the String steady pool as of now contains a string equivalent to the String object as controlled by the equals(Object) technique, at that point the string from the pool is returned. Generally, the String object is added to the pool and a reference to the String object is returned. The errand of intern() technique is to put String (that is passed to the intern methodology) into the string steady pool.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Java String Interview Questions

    What do you understand by the term String with respect to Java?

    With respect to Java, a String can be attributed internally by a variety of byte esteems..

    Java String Interview Questions

    What technique can be employed to compare two Strings?

    There are different approaches to think about two String like equivalents() technique..