What are abstract classes? Don\'t interfaces also allow for polymorphism? If so, what is the difference between abstract classes and interfaces? Which would you choose when? Solution (i) Abstract class: abstract class is a class that is declared abstract. -It may include or may not include abstract method. -It can be subclassed ,but cannot be instantiated. -A abstract method is a method that is declared without an implementation. e.g abstract void drive1() If a class includes abstract methods,then the class declare itself as abstract. e.g public abstract class DriveCar { abstract void drive1(); } (ii) Interface allow polymorphism.It formalize polymorphism. If two elements realizes the same interface,then only these are polymorphic w.r.t a set of behaviors . It gives good description of working of polymorphism & allows us to define polymorphism in a declarative way. (iii) Difference between abstract classes & interfaces: It can extent only one class or one abstract class at a time. It can have abstract and non-abstract methods. (iv) We would use abstract class in the following scenerio: (i)When we want to use inheritance as it provides a common base class implementation to derived classes. (ii)When we want to declare non-public method as Interface has all methods as public only. (iii)When we want to add methods in future because if you add a method to interface,then all of the classes that are already implemented ,needed to be changed. We would use interface in the following scenerio: Interface is used when we need to implement multiple inheritance.Abstract ClassInterface It can extent only one class or one abstract class at a time. It can extent any number of interfaces at a time. It can have abstract and non-abstract methods. It can have only abstract methods.It can have protected ,public abstract methods.It can have only public abstract method.abstract keyword is used to declare it.interface keyword is used to declare itA class can extent only one abstract class. A class can implement any number of interfacesIt can be inherited by a class or an abstract class. It can be extended only by interfaces.Classes has to implement them instead of extend. It can have static methods,main methodds and constructor. It can\'t have static methods,main methodds and constructor..