what is difference between String buffer and String builder?
Answer Posted / rajujohn
hi All
Both are mutable ,that means we can change value of the
instance variable using append,insert and ...
But only one difference when you go for the multi-thread
concept you use StringBuffer,Because it is thread safe ,that
means, if one thread access this stringbuffer variable on
the time another thread cant access this stringbuffer,so
stringbuffer is slowest performance compare to stringbuilder.
by raju.j
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What do you mean by synchronized non access modifier?
Can subclass overriding method declare an exception if parent class method doesn't throw an exception?
Can we call a non-static method from inside a static method?
Explain about version control?
Draw a UML class diagram for the code fragment given below: public class StringApplet extends Applet { private Label sampleString; private Button showTheString; private ButtonHandler bHandler; private FlowLayout layout; public StringApplet() { sampleString = new Label(" "); showTheString = new Button (" Show the String"); bHandler = new ButtonHandler(); layout = new FlowLayout(); showTheString.addActionListener(bHandler); setLayout(layout); add(sampleString); add(showTheString); } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { samplestring.setText("Good Morning"); } } } Note: The methods need not be indicated on the diagram.
When the constructor of a class is invoked?
what are the states associated in the thread? : Java thread
Can I declare a class as private?
What are the advantages of java over cpp?
How do you differentiate abstract class from interface?
What are three types of loops in java?
What is the difference between multitasking and multithreading in Java
What is thread life cycle?
What is encapsulation in java?
When is finally block not called?