Difference between String & StringBuffer

Answer Posted / ramesh raju

String s1="prabas";
String s2="raju";
String s3=s1.concat(s1);//s1=s2.concat("xyz") its not work
We didn't chang the content of s1,s2 strings
that's y String is Immutable

where as StringBuffer is mutable we can easly modified the
content

Is This Answer Correct ?    26 Yes 43 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is daemon thread and which method is used to create the daemon thread? : Java thread

521


what is the messsage u r going to get from an objectoriented programing?

1602


What is the main use of java?

567


If goto and const is reserve words than why it is not work in java?

1500


State the main difference between c++ and java?

586






Can java object be locked down for exclusive use by a given thread?

576


How do you initialize an arraylist in java?

503


Can a static class implement an interface?

544


How do you add an element to a hashset in java?

486


What is byte value?

549


Can a class extend 2 classes in java?

549


What is variable in java?

516


Explain constructors and types of constructors in java.

637


What are the advantages of java over cpp?

546


What is the full form of jpeg?

511