Let’s be Abstract !!
I was wondering that how interviewers going to plan the technical interviews in 2021 and what will they going to ask ?
So, recently I gave interview and I did not get any change in terms of -questions. Old and buggy questions which keep on repeating related to OOPS.
Still we should revise these questions for crack the interview….
So, Are you ready ?
Q1. What is abstract ? What is abstract class ?
Abstract : existing only as an idea, not as a physical thing.
1. When you have requirements and product specification. Abstract class provide the partial implementation for the functionalities and cannot be instantiated.
Q2. Can we create abstract method without abstract class ? but Why?
NO. You need to make your class as abstract and then use abstract method.
Why → Because one will not create the object of abstract class and abstract functions are not used for called but for derivation.
Q3. Can abstract class have abstract and non-abstract method ?
Yes, we can have both kinds of methods.
Q4. Can we call abstract class as Interface ? If yes then why we need both ?
Yes in other terms, abstract class is purely 100% interface with one keen difference :
a. Abstract provides the partial implementation | Interface is only allow to declare the functions.
b. Derived class can inherit one class | Can inherit with multiple Interfaces.
Q5. Can we create an Instance of an Abstract class ?
NO. you cannot.
Q6. Can we create constructor in Abstract class ?
Yes we can public constructor (not static constructor )in abstract class.
Q7. Can we create static methods in Abstract class ?
Yes we can create and call from abstract class name.
Bumper Question associated with Previous one
Q8. When we cannot create the instance of abstract class :-
1. Then what is the use of having constructor ?
OR
2. How we can call the non abstract functions ?
1. To call the non abstract methods of base class, child class will call the base class constructor to be initialized.
2. Using the derived class instance, you can easily call the non abstract methods.
If there is any change in the later framework, that I might not aware about related to this, please do mention !!
That enough for today !!! I will come with next series of questions soon. If it is worth for you then don’t hesitate to claps as much as you want from below.