Abstract class consists of concrete methods and abstract methods.
Interface Consists of only abstract methods and final variables.
public class animal
public class Lion extends animal
public class
Cow extends animal
Take an example of animal class.
Take the method definition of eating contents. For Lion class, this will be meat. But for Cow class this will be only
grass.
Take one more parameter of legs and tail. For both the above classes the legs and tail definition is same.
So here we have to use abstract class because One legs and tail is same for both the classes Lion and Cow and that method is defined in super class animal. The other method eating() is overridden by the subclasses to define their own definition based on the specific animal.
For interfaces, all the method definitions will be specific to each sub class. So they will be only defined in the interface and is implemented in the subclass as per the functionality which is specific. In the above example if there is only one method i.e., eating() and if we don't consider legs and tail() method, then it is obvious that we should use interface rather than abstract class.
"Moreover there are not any hardcore rules that for this we have to use Abstract class and for that we have to use interfaces". We can nearly implement in interface everything what all we are implementing in abstract class and vice versa. Also remember that abstract class consists of contrete methods and abstract methods.