class SimpleClass { id : number | undefined ; print ( ) { console . log ( `SimpleClass.id = ${ this . id }` ) ; } } let mySimpleClass = new SimpleClass ( ) ; mySimpleClass . id = 2020 ; mySimpleClass . print ( ) ; class ClassA implements IPrint { print ( ) { console . log ( `ClassA.print() called.` ) ; } ; } class ClassB implements IPrint { print ( ) { console . log ( `ClassB.print() called.` ) ; } ; } interface IPrint { print ( ) : void ; } function printClass ( a ) { a . print ( ) ; } let classA = new ClassA ( ) ; let classB = new ClassB ( ) ; printClass ( classA ) ; printClass ( classB ) ; class ClassC { print ( ) { console . log ( `ClassC.print() called.` ) ; } ; } let classC = new ClassC ( ) ; printClass ( classC ) ; class ClassWithConstructor { id : number ; constructor ( id ) { this . id = id ; } } let classWithConstructor = new ClassWithConstructor ( 10 ) ; console . log ( `classWithConstructor = 
    ${ JSON . stringify ( classWithConstructor ) }` ) ; class ClassWithPublicProperty { public id : number | undefined ; } let publicAccess = new ClassWithPublicProperty ( ) ; publicAccess . id = 10 ; class ClassWithPrivateProperty { private id : number ; constructor ( id ) { this . id = id ; } } let privateAccess = new ClassWithPrivateProperty ( 10 ) ; privateAccess [ "id" ] = 20 ; class ClassWithCtorMods { constructor ( public id , private name ) { } } let myClassMod = new ClassWithCtorMods ( 1 , "test" ) ; console . log ( `myClassMod.id = ${ myClassMod . id }` ) ; class ClassWithReadonly { readonly name : string = "test" ; constructor ( name ) { this . name = name ; } } class ClassWithAccessors { private _id : number = 0 ; get id ( ) : number { console . log ( `get id property` ) ; return this . _id ; } set id ( value ) { console . log ( `set id property` ) ; this . _id = value ; } } let classWithAccessors = new ClassWithAccessors ( ) ; classWithAccessors . id = 10 ; console . log ( `classWithAccessors.id = ${ classWithAccessors . id }` ) ; class StaticFunction { static printTwo ( ) { console . log ( `2` ) ; } } StaticFunction . printTwo ( ) ; class StaticProperty { static count = 0 ; updateCount ( ) { StaticProperty . count ++ ; } } let firstInstance = new StaticProperty ( ) ; let secondInstance = new StaticProperty ( ) ; firstInstance . updateCount ( ) ; console . log ( `StaticProperty.count = ${ StaticProperty . count }` ) ; secondInstance . updateCount ( ) ; console . log ( `StaticProperty.count = ${ StaticProperty . count }` ) ; namespace FirstNameSpace { export class NameSpaceClass { } class NotExported { } } let nameSpaceClass = new FirstNameSpace . NameSpaceClass ( ) ; class BaseInterfaceClass { id : number = 0 ; print ( ) { console . log ( `this.id = ${ this . id }` ) ; } } interface IBaseInterfaceClassExt extends BaseInterfaceClass { setId ( _id ) : void ; } class ImplementsExt extends BaseInterfaceClass implements IBaseInterfaceClassExt { setId ( id ) { this . id = id ; } }