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 is null statement?
Why is string builder not thread safe?
how many types of Inheritance?
What is difference between word and integer?
What is the intersection and union methods?
What is the difference between sleep and wait in java?
Write a function for palindrome and factorial and explain?
Why map is used in java?
What is anagram word?
Can you add null to a list java?
How big is a gigabyte?
What is adapter in java?
what invokes a threads run() method? : Java thread
What is mean by collections in java?
What is java volatile?