TypeScript supports all typical object-oriented concepts. Each class is both a type and a set of instructions on how to build instances of that type. Classes have constructors and instance members that may be properties, accessors, or methods. Each of them may have the private, protected, or public modifier. Private members are accessible only from inside a class, the protected ones are also from inheriting classes, while public members are publicly available from the remainder of the code. Properties may be decorated with the readonly modifier, in which case they are read-only and may be assigned a value only from inside the class constructor. Properties that are assigned a value from constructor parameters may be declared in the constructor itself together with the parameters they take the value from.
Class instances are created with the new keyword followed by the class...