A class can reused the properties and methods of the base class.
protected
, private
, public
, readonly
, static
protected
= implies that the method or property is accessible only internally within the class or any class that extends it but not externallyprivate
= can be accessed only within the class and even their sub-classes won't be allowed to use their private properties and attributespublic
= By default, all members of a class in TypeScript are public. All the public members can be accessed anywhere without any restrictions.readonly
= Read-only members can be accessed outside the class, but their value cannot be changed. They either need to be initialized at declaration or initialized inside the class constructorstatic
= The static members of a class are accessed using the class name and dot notation, without creating an object e.g. <ClassName>.<StaticMember>
.type
vs interface