Skip to content

Instantly share code, notes, and snippets.

@buntine
Created September 4, 2016 09:05
Show Gist options
  • Save buntine/8753bf985d8764baeb9a6b4beb920b4a to your computer and use it in GitHub Desktop.
Save buntine/8753bf985d8764baeb9a6b4beb920b4a to your computer and use it in GitHub Desktop.
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