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 data type in java?
When should a function throw an exception?
Why a dead thread occurs?
What are the advantages of exception handling?
what is a working thread? : Java thread
What are constants?
Define jre i.e. Java runtime environment?
What is java console application?
What is size of int in java?
Differentiate storage classes on the basis of their scope?
Which is illegal identifier in java?
Write a program to reverse a number in java?
What is the difference between length and length() method in java?
What are methods and how are they defined?
Explain java coding standards for interfaces?