Super Keyword in JAVA: The super keyword in Java is a reference variable which is used to refer immediate parent class object.

Whenever you create the instance of a subclass, an instance of the parent class is created implicitly which is referred by super reference variable.

Usage of Java Super Keyword:  

1. super can be used to refer immediate parent class instance variable.

2. super can be used to invoke immediate parent class method.

3. super() can be used to invoke immediate parent class constructor.


1) super is used to refer immediate parent class instance variable.

we can use super keyword to access data member or field of the parent class. It is used if parent class and child class have the same fields.

Difference b/w StringBuffer & StringBuilder:

StringBuffer: 1. Every method present in StringBuffer is synchronized.
                      2. At a time only one thread is allowed to operate on StringBuffer object. hence          StringBuffer object is thread-safe.
                      3. It increases waiting time of threads so performance is low
                      4. Introduced in 1.0 version.

StringBuilder: 1. No method present in StringBuilder is synchronized.
                        2. At a time multiple threads are allowed to operate on StringBuilder Object. Hence StringBuilder is not thread-safe.
                        3. Threads are not required to wait to operate on StringBuilder object hence relatively performance is high.
                        4. Introduced in 1.5 version.

Difference b/w String and StringBuffer:

1. once we created a string object we can't perform any changes in the existing object. if we are trying to perform any changes with those changes a new object will be created. this non-changeable nature is nothing but immutability of the string object.

2. Once we created a StringBuffer object we can perform any type of changes in the existing object. This changeable is nothing but mutability of the StringBuffer object.


Difference b/w Interface and Abstract Class:

Interface: if we don't know anything about implementation just we have requirement specification than we should go for an interface.

Inside interface, every method is always public and abstract whether we are declaring or not.

We can't declare the interface method with protected, private, final, static, synchronized, native.

Every variable inside interface is always public, static and final whether we are declaring or not.

We can't declare interface variable with private, protected, volatile, transient.

Inside interface, we can't declare instant and static block otherwise we will get compile time error.

Inside interface, we can't declare constructors.

Abstract class: if we are talking about implementation but not completely than we should go for Abstract Class.

Every method present in the abstract class need not be public and abstract. We can take a concrete method also.

There are no restrictions on the Abstract Class method modifiers.

The variable inside abstract class need not be public, static and final.

There are no restrictions on the Abstract Class variable modifiers.

inside the abstract class, we can declare an instant and static block.

Inside Abstract Class, we can declare constructors.