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
Can we override main method?
assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).
What is an interface in oop?
write string class as your own class in java without using any built-in function
Why do we use class in oops?
What are benefits of oop?
What is the point of oop?
program for insertion ,deletion,sorting in double link list
#include
What is the difference between abstraction and polymorphism?
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?
#include
What is interface in oop?
What is a class oop?
officer say me - i am offered to a smoking , then what can you say