ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
Difference between String and StringBuffer.
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Difference between String and StringBuffer.
Answer
# 1
string is imutable and stringbuffer is mutable
 
Mutable means storing location is same
Imutable means storning location is different
 
Is This Answer Correct ?    6 Yes 0 No
Madhu
 
  Re: Difference between String and StringBuffer.
Answer
# 2
hi
 i am agree with Madhu , 
String is an immutable object. StringBuffer is a mutable 
object. 
immutable object:If you are not allowed to change the value 
of an object, it is immutable object.

mutable object: If a object value is changeable then we can 
call it as Mutable object.
 
Is This Answer Correct ?    13 Yes 0 No
Minu
 
 
 
  Re: Difference between String and StringBuffer.
Answer
# 3
String and StringBuilder class stores strings. But when you
cannot change a String object after creating one.
eg: String name = "Prasad";
By saying you cannot change the name object means you cannot
change the value in name object internally. When you change
the name object value to something else, a new String object
is creating in memory and assign the new value.

eg: name = "Prasad Reddy";

A new name object is creating in memory and the value
"Prasad Reddy" is assinging to the newly created space.

But StringBuilder class occupies the same space even if you
change the value.

If you are doing string concatenation StringBuilder class is
far better in performance than String class.

You can use StringBuilder's Append() method to use
concatenation.
 
Is This Answer Correct ?    2 Yes 0 No
Geetha
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Difference between String and String Buffer?  3
How do you set security in applets? Wipro1
heavy components means what?  4
Diff between C++ and java? TCS8
types of applets?. TCS3
Difference String and String Buffer  3
write a progam hashmap & hashtable? IBM2
string is immutable? right every one knows that, my question is it advantage or disadvantage making string immutable? HCL4
what are ER diagrams?  2
when we have to use final class in java?  2
How will you create the class for the following scenario? Employees under one employee? Bally-Technologies2
Which class is extended by all other classes?  2
What is the middleware?  2
Difference between Web-based applications,Client- Server applications and Distributed applications? Infosys2
Can a class inherit the constructors of its superclass? Wipro7
Which containers use a FlowLayout as their default layout?  3
Can an abstract class be final?  6
What is cloneable interface?  5
What are wrapper classes? Noah-Solutions6
What classes of exceptions, thrown by a throw statement?  2
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com