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


Please Help Members By Posting Answers For Below Questions

What is an advantage of polymorphism?

589


What is pure oop?

597


Do you know about multiple inheritance?

637


How long to learn object oriented programming?

561


What does and I oop mean in text?

620






What is the point of polymorphism?

584


Is html an oop?

579


How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction

1652


What is persistence in oop?

669


What is interface in oop?

660


What are the features of oop?

635


Why is static class not inherited?

593


What is difference between data abstraction and encapsulation?

613


design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

6144


What is overloading and its types?

612