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

Explain importance of finally block in java?

819


Why java is a platform independent? Explain

772


What is a copy constructor in java?

829


What is overriding in java?

771


What are advantages of using Java?s layout managers than windowing systems?

2099


Can you explain the final method modifier?

783


How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?

780


What is type parameter in java?

721


What is r * in math?

749


How to create a custom exception?

764


how many types of Inheritance?

944


Is static a singleton?

751


How can we access some class in another class in java?

778


How many types of threads are there in java?

771


What do you mean by local variable and instance variable?

731