In real time project when will we use Abstract class. and
what are the difference between abstract and interface.
Answer Posted / naveen verma
Abstract Class:- its should have declared as abstract and must contain atleast one abstract method. an abstract class can be extended from either an abstract class or the class which is extending the abstract class should implement all methods of abstract method.
Interface:- In interface the methods are only declared not define the class which implementing the interface can define the method body as per its need. its not mendatory to define every method of the interface.
In really time application we extend abstract class only we when we need to modify the class. where as interface can be used to implements its method.
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
How substring() method of string class create memory leaks?
Define aop(assepct oriented programing)?
What are callback interfaces?
How to deploy Jar, War files in J2EE?
What is clustering? What are the different algorithms used for clustering?
Where can I find seam examples and documentation?
Where can I ask questions and make suggestions about seam?
Can constructors be synchronized in java?
Can I use javascript to submit a form?
What is a modular application? What does module-relative mean?
Explain what is synchronization?
Is jvm a overhead?
What is the map interface?
What is JTS?
What is synchronization and why is it important?