Java Interview Questions
1 .
What is the difference between String and StringBuffer classes?
String class objects are immutable and hence their contents cannot be modified. StringBuffer class objects are mutable, so they can be modified. Moreover the methods that directly manipulate data of the object are not available in String class. Such methods are available in StringBuffer class.
2 .
Are there any other classes whose objects are immutable?
Yes, classes like Character, Byte, Integer, Float, Double, Long... called ‘wrapper classes’ are created as ‘immutable’. Classes like Class, BigInteger, BigDecimal are also immutable.  
3 .
What is the difference between StringBuilder and StringBuffer classes?
StringBuffer class is synchronized and StringBuilder is not. When the programmer wants to use several threads, he should use StringBuffer as it gives reliable results. If only one thread is used, StringBuilder is preferred, as it improves execution time.
4 .
Which of the two "StringBuilder" or "StringBuffer" is faster and Why ?
StringBuilder is not synchronized and hence faster than StringBuffer.
5 .
Special operations those we can only perform on StringBuffer and StringBuilder:
append
insert
delete
reverse
Since string is immutable we cannot perform these operations on String.
6 .
Advantage and disadvantage of StringBuffer or StringBuilder:
Advantage : It given high performance because consumes less memory as all modifications stored in same memory.
Disadvantage: Original value will not be preserved.
7 .
What is the difference between object oriented programming languages and object based programming languages?
Object oriented programming languages follow all the features of Object Oriented Programming System (OOPS). Smalltalk, Simula-67, C++, Java are examples for OOPS languages.

Object based programming languages follow all the features of OOPS, except inheritance. For example, JavaScript and VBScript will come under object based programming languages.
8 .
What is object oriented approach?
Object oriented approach is a programming methodology to design computer programs using classes and objects.
9 .
What is a class?
A class is simply a representation of a type of object. It is the blueprint/ plan/ template that describe the details of an object.
10 .
What is an object?
Object is termed as an instance of a class, and it has its own state, behavior and identity.