Difference between abstract class and Interfaces?

Answer Posted / ranganathkini

An Interfaces defines a public contract of methods for the
classes that implement it. An implementing class must
implement all the method defined by the interface.

An abstract class on the other hand not only defines a
public contract of methods but may also provide partial
implementation of some or all of the class methods. A
subclass of an abstract class inherits the partial
implementation (if any) or must provide a concrete
implementation of the abstract methods.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the major advantages of internal iteration over external iteration?

572


What is class forname used for?

538


What is the best definition for data?

518


What is the difference between equals() and == in java?

522


Give a practical example of singleton class usage?

591






What is token in java?

533


What is field name?

585


Is null == null in java?

648


Difference between overriding and overloading in java?

576


Why java doesn’t support multiple inheritances?

581


Define max and min heap, also the search time of heap.

587


What is the difference between break and continue statements?

547


What is ‘is-a ‘ relationship in java?

587


Is object a data type?

556


How to optimize the javac output?

594