What is an abstract class?
What is an abstract class?
249
23-Aug-2021
Ashutosh Kumar Verma
26-Aug-2021Abstract class- An Abstract class is a class which is defines with 'abstract' keyword. There are not create instance of abstract class. To use the methods of abstract class we need to inherit it in other regular class by using semicolon(:). An abstract class can contain abstract methods and also regular methods. All abstract method have must to redefined or override in derived class because in abstract class all abstract methods only being declare, to provide its body we need to override it in derived class. Whereas all regular methods declare in abstract base class we can provide its definition in same class.
Output- Dog is bark
Cat cry meow meow