Wednesday, April 3, 2019

StringBuffer vs String

String is an inflexible (immutable) class, i.e. you can not modify its content once created. 
While StringBuffer is a mutable (variable, change-able ) class, means you can change its content later. Whenever we alter content of String object, it creates a new string and refer to that,it does not modify the existing one. This is the reason that the performance with StringBuffer is better than with String.

2 comments:

Write a program in python which determine determines that the number is prime or not. What is your favorite number?

Write a program in python which determine determines that the number is prime or not. What is your favorite number? Code   number = int(inpu...