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 the full form of oops?
What is abstract class in oop?
can inline function declare in private part of class?
What is interface? When and where is it used?
What is the point of polymorphism?
What are the benefits of interface?
Why is oop useful?
Can you inherit a private class?
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer
Which language is not a true object oriented programming language?
What is oops in simple words?
Why multiple inheritance is not possible?
Can enum be null?
explain sub-type and sub class? atleast u have differ it into 4 points?
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.