class Point { x : number ; y : number ; constructor ( x , y ) { this . x = x ; this . y = y ; } add ( point ) { return new Point ( this . x + point . x , this . y + point . y ) ; } } var p1 = new Point ( 0 , 10 ) ; var p2 = new Point ( 10 , 20 ) ; var p3 = p1 . add ( p2 ) ; class Point3D extends Point { z : number ; constructor ( x , y , z ) { super ( x , y ) ; this . z = z ; } add ( point ) { var point2D = super . add ( point ) ; return new Point3D ( point2D . x , point2D . y , this . z + point . z ) ; } } class Something { static instances = 0 ; constructor ( ) { Something . instances ++ ; } } var s1 = new Something ( ) ; var s2 = new Something ( ) ; console . log ( Something . instances ) ;