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

why doesn't java run on all platforms?

783


What is difference between static class and singleton pattern?

692


When do we use synchronized blocks and advantages of using synchronized blocks?

901


Why can't you declare a class as protected?

807


What do you mean by composition in java?

780


What is abstract class? Explain

788


How you can force the garbage collection?

748


Explain an algorithm to find depth of a binary tree.

798


What is the difference between the font and fontmetrics classes in java programming?

711


What does the append?

718


What is a protected class in java?

762


Can we use a switch statement with strings?

774


Is main a keyword in java?

748


What happens to the Exception object after handling an exception?

2081


What is the use of a copy constructor?

769