N/APosted on - 08/09/2011
Does anyone know in what exact situation one is supposed to declare a class as abstract?
How will I come to know the parameters that have been analyzed for a class to be abstract and how would I declare it abstract?
I would also like to know the difference between abstract class and interface.
Abstract class scenario and difference between interfaces.
In program language, an abstract class has more than one or one functions that haven’t implemented and can’t be instantiated.
Functions are implemented when a class inherits from the abstract class.
The main benefit of claiming the abstract class is that an inherited derived-class could has its implementation for any unimplemented functions. Moreover, a derived class could inherit from different abstract classes.
The abstract class is very similar to the interface but some differences could be found between them, e.g. a derived class may implement unlimited interfaces, but could inherit from one abstract class only.
Moreover, an abstract class can comprise of several abstract properties, methods and any other members, but an interface could only contain abstract properties, default public and methods.
Please follow this link for more information: Abstract Class vs Interface