what is the difference b/w abstract and interface?
Answer Posted / bhaskar.mantrala
Interfaces are same as classes but their methods are
declared with out any body..... and definition
corresponding to that allmethods will write on
implementation class(i.e)single class.BUT
Eg:
interface interfacename
{
//Declarations only
//first method
//second method
..
..
//n-th method
//final variables
}
class classname implements interfacename
{
//Definitions of ALL methods present in interfacename
}
Abstract class also has same as interface and definitions of
all those methods may not be present in single extended class.
And we doesn't create an object to class that is abstract.
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What is polymorphism and why is it important?
What is coupling in oop?
What are the two different types of polymorphism?
what is difference between class template and template class?
to find out the minimum of two integer number of two different classes using friend function
Which type does string inherit from?
2. Give the different notations for the class.\
Why do we use class in oops?
What is the difference between inheritance and polymorphism?
Why do we use encapsulation in oops?
How to use CMutex, CSemaphore in VC++ MFC
what are the different types of qualifier in java?
Can a destructor be called directly?
What is stream in oop?
Can abstract class have normal methods?