Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

why an outer class cannot be declared as private?

4323


What are bind parameters?

1051


Can array grow dynamically in java?

988


What is difference between calling start() and run() method of thread?

1134


Explain the difference between an Interface and an Abstract class?

1175


How many types of methods are there?

1062


Can a class extend more than one class?

1126


What is main in java?

1156


What is class and object in java?

1007


How is string stored in java?

1063


Can bool be null?

988


Why spring singleton is not thread safe?

1002


What is string immutability?

1112


How to overcome the exception object reference not set to an instance of object?

1153


Difference between object instantiation and construction ?

1071