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 size of string?
Differences between C and Java?
I want my class to be developed in such a way that no other class (even derived class) can create its objects. How can I do so?
What are dot operator queries?
How do you check if a number is a perfect square?
What is array class in java?
How do you compare two strings lexicographically?
What is a nested list?
What does a boolean method return?
What are the different types of multitasking?
What is Java Reflection API? Why it’s so important to have?
how to open and edit XML file in Weblogic???
Can we execute a program without main?
What is getkey () in java?
What is the console in java?