How substring() method of String class create memory leaks?
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers

 Q1. How substring() method of String class create memory leaks?Core Java
Ans. substring method would build a new String object keeping a reference to the whole char array, to avoid copying it. Hence you can inadvertently keep a reference to a very big character array with just a one character string.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   string class   string   substring   memory leaks   jvm   memory management   advanced   architecture   technical architect   technical lead      expert


Related Questions

  What are the benefits of using Spring Framework ?
  What are various types of Class loaders used by JVM ?
  Difference between SAX and DOM Parser ?
  What things should be kept in mind while creating your own exceptions in Java?
  Difference between C++ and Java ?
  Different types of memory used by JVM ?
  What are LDAP servers used for ?
  What is the best practice configuration usage for files - pom.xml or settings.xml ?
  Why Web services use HTTP as the communication protocol ?



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: