Abstract class in Java


Abstract class is class which has more than one abstract method which doesn’t have method body but at least one of its methods need to be implemented  in derived Class.
Abstract classes can be used to implement the inheritance relationship between the classes that belongs same hierarchy…. More

What are the differences between interface and abstract class?


The key difference between an interface and the corresponding abstract class is that a class or interface can have unlimited number of immediate super interface but it can only have one super class.
There are two primary axes of “inheritance” an object-oriented language like java. Implementation inheritance is where the sub-class inherits the actual code implementation from the parent. Interface inhyeritance is where the sub-class adheres to the public interface of the parent.
Also java actally mixes the two notions together a bi…. java interfaces are nice and clean. When you implement an interface, you are stipulating that your class adheres to the “contract” of the interface that you spefified. Java class inheritance isn’t so clean when you sub-class in java you are getting both the code inheritance but you are also stipulating that you sub-class adheres to the contract of the interface of the parent class.

Abstrct class in java are just like regular java classes but with the added constraint that you cannot instance then directly. In terms of that added constraint, they are basically classes which don’t actually implement all lof the code specified by their “contract”.