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 the collections api?
what is the difference between yielding and sleeping? : Java thread
What is data type in computer?
Which api is provided by java for operations on set of objects?
Which are the two subclasses under exception class?
Which list does not allow duplicates in java?
What does pointer mean?
What are the four versions of java?
What is lifetime variable?
Explain JMS in detail.
Explain how hashmap works?
What is the java virtual machine?
Is an object null?
How hashset works internally in java?
Is java call by value?