In real time project when will we use Abstract class. and
what are the difference between abstract and interface.

Answer Posted / aravind

Depending upon the requirement.

Abstract class---->it contains zero or more abstract methods.

ex HttpServlet and GenericServlet
HttpServlet contains all sre concrete methods but it
declared as a Abstract class.

InterFace--->It contains all abstract methods.

if we extends the abstract class .there is chance to extend
another class.

if we implements the interface we can extends another class

Is This Answer Correct ?    17 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to use debug in my elipse to solve problems that exist in my project

1753


Are enterprise beans allowed to use thread.sleep()?

633


What is a class loader?

573


Is there a guarantee of uniqueness for entity beans?

556


How database connectivity in XML is achieved?

1758






What is a session? Can you share a session object between different theads?

544


How task's priority is used in scheduling?

1766


what are getters and setters in Java with examples?

1275


What are the different algorithms used for clustering?

537


Why are my checkboxes not being set from on to off?

624


In inglish: How to convert jar to exe files? Em português: Como converter arquivos .jar para .exe?

2146


Can I import same package/class twice? Will the jvm load the package twice at runtime?

636


What is the difference between system.out ,system.err and system.in?

587


What if the static modifier is removed from the signature of the main method?

685


What is abstract schema?

542