what is abstract class ?
when is used in real time ?
give a exp
Answer Posted / ramakrishna yechuri
An Abstract class ia class which consists at least one
abstract method(in complete method).
Advantage is the user can implement the method body as per
his require ment.
ex: connect(){} ,I implement to conncect to oracle
database,u implement to conncet to sybase,my friend
implement this method to connect to oracle db. same connect
method acting in different forms (polymorphisim).
Note: Always Interfaces is better than Abstract class,becoz
Programming to Interface is better than programming to
classes.
To avoid dependency Injection problems.(spring).
| Is This Answer Correct ? | 14 Yes | 4 No |
Post New Answer View All Answers
How do you use inheritance in unity?
What is a function in oop?
What is destructor example?
What do you mean by overloading?
Why do we use inheritance?
What is the full form of oops?
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
What is class and example?
What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }
write a C++ program for booking using constructor and destructor.
What is polymorphism give a real life example?
#include
What is polymorphism in oops with example?
How do you define a class in oop?
What are the three main types of variables?