Explain Inheritance in Typescript?

Inheritance is an aspect of OOPs language that provides the ability to a program to create a new class from an existing class. It acquires properties and behaviour from one class to another class. TypeScripts supports single and multilevel inheritance. A class whose members are inherited is called the base class and the class that inherits those members is called the derived/sub/child class.

Syntax:

class super_class_name 

{ 

        // methods and fields 

}

class sub_class_name extends super_class_name 

{ 

        // methods and fields 

}