what is an interface and what is an abstract


What is an interface and what is an abstract class? Please, expand by examples of using both. Explain why?  

Abstract classes are closely related to interfaces. They are classes that cannot be instantiated, and are frequently either partially executed, or not at all implemented. One key difference among abstract classes and interfaces is that a class may execute an unlimited number of interfaces, but may inherit from only single abstract (or any other kind of) class. A class that is derived from an abstract class may still execute interfaces. Abstract classes are useful when creating components because they permit you specify an invariant level of functionality in some methods, but leave the implementation of other methods until a specific implementation of that class is required. They also version well, because if additional functionality is required in derived classes, it can be added to the base class without breaking code.

 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: what is an interface and what is an abstract
Reference No:- TGS0289696

Expected delivery within 24 Hours