What is the difference between the string and stringbuffer classes?



What is the difference between the string and stringbuffer classes?..

Answer / Md Ataul Mustafa

String and StringBuffer are both used to represent sequences of characters in Java, but there are differences between them. Strings are immutable (once created, they cannot be changed), while StringBuffers are mutable (they can be modified after creation). Additionally, String objects are constant and final, whereas StringBuffer is a class that provides methods for manipulating strings.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Advanced Java Interview Questions

What is the use of Semaphore?

3 Answers  


Explain the steps in details to load the server object dynamically?

1 Answers  


Can I import same package/class twice? Will the jvm load the package twice at runtime?

1 Answers  


What is Connection Pooling?

1 Answers   Enteg Technologies, Infosys, Polaris,


What is the name of the state, when a thread is executing?

4 Answers  


What is source and listener?

1 Answers  


whats is mean by tiles in struts

2 Answers   SolutionNET,


What you mean by COM and DCOM?

1 Answers  


How many layers are there in RMI and what are they?

1 Answers  


How are the elements of a cardlayout organized?

1 Answers  


Why are my checkboxes not being set from on to off?

1 Answers  


difference between apllet and interface class

1 Answers   Infotech,


Categories