CoolInterview.com - World's Largest Collection of Interview Questions
Start Your Own website Now
Sponsored Links

Interview Questions
Our Services

Get 9,000 Interview Questions & Answers in an eBook.


  • 9500+ Pages
  • 9000 Question & Answers
  • All Tech. Categories
  • 14 MB Content

    Get it now !!



    Send your Resume to 6000 Companies


  • INTERVIEW QUESTIONS J2EE JAVA DETAILS
    Question :
    What is the difference between String and StringBuffer? Which is better to use in project?



    Category Java Interview Questions
    Rating (0.4) By 421 users
    Added on 7/16/2006
    Views 1980
    Rate it!
    Answers:

    When a String is created, it is not destroyed. It remains in the pool of memory and whenever that string is referred, the JVM searches for the String from the string pool of memory and gets the relevant data. So as such String is expensive operation.

    String buffer can be changed/modified based on our requirement. There are chances that you may need to form a query based on some conditions. Such queries can be formed using String buffer. Finally you can user the toString method to get the final String version of the stringBuffer.



    If you have the better answer, then send it to us. We will display your answer after the approval.
    Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification  Enter the above shown code:*
    Inform me about updated answers to this question

       
    Related Questions
    View Answer
    What's the difference b/w Java command line arg.s & C command line arg.s?

    View Answer
    what is difference between instance and object.?
    what are the all difference between interface and abstract class?

    View Answer
    What is collection framework?what interfaces and
    classes support collection framework?

    View Answer
    why java does not support inheritance of multiple superclasses?
    what is achieved by inheritance?
    why there is no main method in servlets/jsps?

    View Answer
    How can we use hashset in collection interface?

    View Answer
    What is difference between java.lang .Class and java.lang.ClassLoader? What is the hierarchy of ClassLoader

    View Answer
    What is difference between array & arraylist?


    View Answer
    if interface & abstract class have same methods & abstract class also not contain any implementation for those methods which one you prefer ?

    View Answer
    How can you load DLL files when your java class is loading first time ?

    View Answer
    What is difference between string and stringtokenizer?

    View Answer
    We know that Object class is super class of every class & a class extends only one class. so
    how is it possible to a class to extend other than Object class?





    View Answer
    What is JVM Heap Size? How does it affect the performance of the Application?

    View Answer
    How many JVM could be run on an operating system. if only one then what is the logical reason.

    View Answer
    What are differences between Enumeration, ArrayList, Hashtable and Collections and Collection?

    View Answer
    Which class is the super class for all classes in java.lang package?

    View Answer
    Why the container does not support multiple layout managers

    View Answer
    How to use JNI in java? and what are Struts and jini?and how to apply native code in java?

    View Answer
    Can wehave run() method directly without start() method in threads?

    View Answer
    When programmer using the vector and arrylist? and when ur using linkedlist and hashmap and hashtable?

    View Answer
    WHEN UR USING ARRAYLIST AND LIKEDLIST AND VECTOR AND HASHMAP AND HASHTABLE?

    View Answer


    Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

    View ALL Java Interview Questions

    User Options
    Sponsored Links


    Copyright ©2003-2014 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions

    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Dedicated Servers | C Interview Questions & Answers

    Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes


    Cache = 0.015625 Seconds