All About Abstract Classes


Abstract classes and its implementation and uses importance of the Abstract Classes the point of view of Real World Applications and scenarios Abstract classes and its implementation and uses importance of the Abstract Classes We come across the question like What is Abstract class? When we use Abstract Class? Why we need a class that cannot be instantiated

Abstract Classes is important from the point of view of Real World Applications and scenarios.

We come across the question like

1. What is Abstract class?
2. When we use Abstract Class?
3. Why we need a class that cannot be instantiated?

Which are made clear with some of the points about I have given on Abstract Classes

1.Abstract Class lets subclasses redefine the implementation of its methods and properties while preserving the
polymorphism of those classes.

2.An abstract class is used when you have some base functionality that you want subclasses to inherit
One reason for using abstarct classes is we can code common functionality and force our developer to use it.
Another use of using an abstract class is that you can group several related classes together as siblings.
Abstract classes act as Template classes for future classes. sometimes it makes no sense to implement every method in a class, it might implement some methods to be inherited by sub classes


Abstract Class


Shape is an example of Abstract Class. An abstract class is one whose main purpose is to define a common interface for its subclasses.

This simplifies client code by causing the code to describe what it wants done without specifying how it should be done. The superclass is called "abstract" because its implementation is incomplete

when there are several classes that need to be defined with similary functionality.
Common functionality is defined at baseclass hierarchy should be extensible so that future subclasses can easily be added without having to change the existing superclass

Abstract class cannot instantiated , it only sets the rules and standards for its subclasses you have to go a long way without needing an abstract class, but they are great for specific things.


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: