raja pulleboina wrote:
please exaplin the real time senario where we can use abstract and interface in java ...???
interface is basically a pure abstract class. interface only specifies the methods that should be present in any class which is implementing that interface.
abstract classes on other hand can have non-abstract methods i.e. methods which are already implemented. these methods can then be directly used in class extending the abstract class.
now the real life difference that comes is basically how you want to implement a certain design problem. interfaces generally define the behavior that a class needs to follow. abstract classes on other hand shows what type of class it is. this is also the difference in extending a class and implementing an interface.