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 is an anonymous class in java?

810


What is main in java?

814


Why collection doesn’t extend cloneable and serializable interfaces?

899


I want to store more than 10 objects in a remote server? Which methodology will follow?

2901


What is difference between iterator access and index access?

870


What are the features in java?

832


How can we pass argument to a function by reference instead of pass by value?

855


What are the important features of Java 9 release?

779


Why Java is not pure Object Oriented language?

884


Which is dependent variable?

690


When is the finalize() called?

931


What do you mean by exception handling in Java?

1015


How do you create a first line indent?

751


Differences between external iteration and internal iteration?

890


Does every java program need a main?

786