How many objects are created when we create String class
object using new operator?

Answer Posted / mahesh

yes two objects will be created when you use new operator
for a String. The reason for this is at first it creates an
object in HEAP and then verifies in the String Constant
Pooling if it is not available then creates the new one in
pool. so totally two object will be created.

Is This Answer Correct ?    22 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by Function Overloading in java?

914


What is arraylist e?

773


What is a generic data type?

732


What is parsing in grammar?

767


What are the important features of Java 9 release?

738


Can we have try block without catch block?

782


What is data movement?

874


What is the use of jtable?

844


What do you mean by composition in java?

765


how to write a server program and sending the mails to the server using smtp protocol please help me

1762


How is hashset defined in java?

717


How many types of methods are there?

732


Which is better ascii or unicode?

750


What do you mean Abstraction in java?

802


What 5 doubled?

722