Difference between String and String Buffer?
Answers were Sorted based on User's Feedback
Answer / janet
1. String objects are constants and immutable where as
StringBuffer objects are not.
2.String class supports constant strings where as
StringBuffer class supports growable and modifiable strings.
| Is This Answer Correct ? | 13 Yes | 0 No |
Answer / sumati
String is immutable
String buffer is mutable
Ex String str = "abc";
str = "new String";
this will creat new memory location and stores "new String"
but in String buffer
StringBuffer strBuf = "abc";
strBuf = "new String"
it will overwrite in same memory location
| Is This Answer Correct ? | 13 Yes | 0 No |
Answer / ravikiran(aptech mumbai)
string is immutable
string buffer is mutable
| Is This Answer Correct ? | 7 Yes | 0 No |
Name the types of 'priority'?
What is methods and methodology?
Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?
Explain the differences between abstraction and encapsulation?
What is oop in java?
How do you classify Dialog Box?
What is boolean data type in java?
Given: 10. interface A { void x(); } 11. class B implements A { public void x() { } public voidy() { } } 12. class C extends B { public void x() {} } And: 20. java.util.List list = new java.util.ArrayList(); 21. list.add(new B()); 22. list.add(new C()); 23. for (A a:list) { 24. a.x(); 25. a.y();; 26. } What is the result? 1 Compilation fails because of an error in line 25. 2 The code runs with no output. 3 An exception is thrown at runtime. 4 Compilation fails because of an error in line 20.
How does sublist works in java?
Can a final variable be manipulated in java?
Iterator in the HashMap is fail-safe means what?
Give me example of derived data types.