what is the difference between abstract class and
Interface?where we can use it in realtime projects?
Answer Posted / sudhakar
1)We define an Interface in the Java application with a
set of abstract methods without any implementation. Which
means all the methods of an interface are by default
abstract methods and public methods.
2)Once an Interface is defined in the application then any
class can implement that interface, in such case the class
must be implemented with all the mehtods of the respective
Interface otherwise the class will become as abstract class.
3)A class can implement any no. of interfaces, in such case
the class must be implimented with all the methods of those
interfaces otherwise the class will become as abstract class
| Is This Answer Correct ? | 125 Yes | 25 No |
Post New Answer View All Answers
What is the purpose of using java.lang.class class?
What is one third plus one third as a fraction?
What is mean by collections in java?
Difference between process and thread?
What is flush buffer?
What is the difference between JVM and JRE?
What do you mean by synchronized non access modifier?
What is foreach loop in java?
Tell us something about an iterator.
What is valid keyword in java?
What is difference between class and object in java?
What is bean? Where it can be used?
What is a lock or purpose of locks in java?
What is the final field modifier?
Can we extend singleton class?