what is difference between abstract and interface?
can i give real time example for the two topics?
Answer Posted / tharun raj s
an abstract class contains 1)instance variables 2)concrete
methods(implemented methods). 3)abstract
methods(unimplemented methods)
An interface contains 1)abstract methods and variables which
are public static and final by default
Abstract class is written when there are certain common
features shared by all the objects
Interface is written when all the features are implemented
differently in different objects
when an abstract class is written it is the duty of the
programmer to provide subclasses to it.
An interface is written when the programmer wants to leave
the implementation to the third party vendors
Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
What is singletonlist in java?
Explain naming conventions for packages?
What are invisible components?.
What will happen to the exception object after exception handling?
Can constructor be protected in java?
Can a class be a super class and a sub-class at the same time? Give example.
What is an object’s lock and which object’s have locks?
Can we use static class instead of singleton?
What is the purpose of the file class in java programming?
What is an inner class in java?
What is the difference between call by reference and call by pointer?
What is string literal in java?
What things should be kept in mind while creating your own exceptions in java?
What do you mean by boolean?
Can we create an object of private class?