Core Java/J2EE interview questions: – By using String or String Buffer performance increases?

Java

Video is ready, Click Here to View ×


In this video we will see performance gain increases by String or by String Buffer in Java. For more videos and training in java see http://www.questpond.com/java/javaj2eedesignpattern.html

6 thoughts on “Core Java/J2EE interview questions: – By using String or String Buffer performance increases?

  1. Why you want to create StringBuffer Instance inside a for loop. StringBuffer is based on decorator pattern to decorate String object and will always cost more if instianted multiple times compare to instianting String object. However we need to measure the memory usage of using String vs String buffer.

  2. In your Dynamic program you are creating the String variable outside the for loop and StringBuffer is created inside the for loop. This is critical and your results are biased.

Leave a Reply

Your email address will not be published. Required fields are marked *