Created
September 4, 2016 09:05
-
-
Save buntine/8753bf985d8764baeb9a6b4beb920b4a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class Building { | |
constructor(public stories: number, public size: number) { | |
} | |
public height(): number { | |
return this.stories * this.size; | |
} | |
} | |
class Hardhat extends Building { | |
constructor(public address: string) { | |
super(1, 3.5); | |
} | |
public details(): string { | |
return `I am ${this.address} and I am ${height} meters tall!`; | |
} | |
} | |
let hhd = new Hardhat("111 High Street"); | |
console.log(hhd); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment