What is intern method in java?



What is intern method in java?..

Answer / Arvind Nath Mishra

"The intern() method returns the String object if it is already interned (i.e., if an exact match for the string can be found among the strings that have been previously interned). If not, it creates a new String object and internally stores it."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Why string is not a wrapper class?

1 Answers  


What is the difference between abstract class and interface?

3 Answers   Aspire,


Can a class be final?

1 Answers  


In the below example, how many string objects are created?

1 Answers  


Explain features of interfaces in java?

1 Answers  


How to access a variable if it is declared as private?

3 Answers  


What is string in java?

1 Answers  


What is string literal in java?

1 Answers  


How OOPS concept is achieved in Java?

6 Answers   Cognizant, JPMorgan Chase, Xavient,


1) There are 10 different threads in runnable state. Each having priority 1 to 10. How does the CPU schedules or executes these threads?

2 Answers   RBS,


What is unicode datatype?

1 Answers  


what is purpose of writting public static void main(Strind arg[]) in java..?

4 Answers   ITC Infotech,


Categories