Difference Between Stringbuffer and Stringbuilder: 4. What Is An Abstract Class?
Difference Between Stringbuffer and Stringbuilder: 4. What Is An Abstract Class?
Abstract class must be extended/subclassed (to be useful). It serves as a template. A class that is
abstract may not be instantiated (ie. you may not call its constructor), abstract class may contain static
data.
Any class with an abstract method is automatically abstract itself, and must be declared as such. A class
may be declared abstract even if it has no abstract methods. This prevents it from being instantiated.
4. What is difference between StringBuffer and StringBuilder in Java ?
Classic Java questions which some people thing tricky and some consider very easy. StringBuilder in
Java is introduced in Java 5 and only difference between both of them is that Stringbuffer methods
are synchronized while StringBuilder is non synchronized. See StringBuilder vs StringBuffer for more
differences.