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 purpose of inheritance?

645


what are the different types of qualifier in java?

1845


Can enum be null?

587


What is meant by oops concept?

614


What is constructor overloading in oop?

607






Which method cannot be overridden?

582


explain sub-type and sub class? atleast u have differ it into 4 points?

1838


What is polymorphism and its types?

599


What do you mean by overloading?

582


What is the main purpose of inheritance law?

673


What is polymorphism oop?

623


what is graphics

2011


What causes polymorphism?

577


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

2762


What is difference between multiple inheritance and multilevel inheritance?

603