abstract class Person {
abstract pName: string;
display(): void{
console.log(this.pName);
}
}
class Employee extends Person {
pName: string;
eID: number;
constructor(name: string, ID: number) {
super();
this.eID = ID;
this.pName = name;
}
}
let emp: Person = new Employee('Professor Albus Dumbledore', 83736);
emp.display();
/*
run:
"Professor Albus Dumbledore"
*/