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
What does index mean in java?
How do you define a variable?
Is null a string or object in java?
What are the types of collections in java?
What does exp mean in math?
Explain wait() method of object class ?
Variable of the boolean type is automatically initialized as?
What do you mean by a JVM?
What are the advantages of java over C++?
Explain oops concepts in detail?
What is a short in java?
What is java in layman terms?
What is a map? What are the implementations of map?
What are pass by reference and pass by value?
What is the best definition for data?