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

What’s jboss cache in short?

614


Why won’t the jvm terminate when I close all the application windows?

766


What is the relation between the infobus and rmi?

568


What is the difference between a static and a non-static inner class?

602


What modifiers may be used with an inner class that is a member of an outer class?

584






Do you think that java should have had pointers?

610


What value does readline() return when it has reached the end of a file?

608


What are transaction attributes?

624


Why use a datasource when you can directly specify a connection details? (in a J2EE application)

3472


What is threadfactory?

623


What are JTA/JTS and how they used by client?

1727


How to implement RMI in Java?

2412


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

653


If I wanted to use a solarisui for just a jtabbedpane, and the metal ui for everything else, how would I do that?

580


Difference between loadclass and class.forname?

611