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
How does hashmap work in java ?
What is the purpose of the file class in java programming?
State differences between C and Java?
Why string is immutable or final in java
Explain about collection interface in java?
What is the difference between static class and normal class?
Is 9 a prime number?
What happens when a thrown exception is not handled?
What are the Main functions of Java?
Explain the pointers in Java?
What is unicode datatype?
How to remove the trailing spaces from a string?
Can we sort list in java?
What is the purpose of static keyword in java?
How are observer and observable used in java programming?