what is meant by string pooling?

Answer Posted / sivadasan

See,

String s = new String("Shiva");

Its creating two instances and one reference.

In the Two instance one is stored in Constant pool and
another one is stored in temp' pool.

What about String s = "Shiva";

Anybody can, pls clarify...

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the parts of a method?

533


Can a final variable be initialized in constructor?

483


What is meant by javabeans?

613


Is it possible to compare various strings with the help of == operator? What are the risks involved?

615


Is there any difference between synchronized methods and synchronized statements?

582






What are streams?

629


What is the basic of java?

568


Why char array is favored over string for the storage of passwords?

555


What is string manipulation?

489


How many types of variables are there?

666


How to disable caching on back button of the browser?

525


What is difference between final and finally in java?

580


What is vector?

587


Does java linked list allow duplicates?

550


What is an eror in java?

557