lab13: impl

This commit is contained in:
2026-04-09 15:57:41 -07:00
parent 4fd0fec404
commit 7b54fa5303
4 changed files with 76 additions and 18 deletions

15
lab13/rabbit.ts Normal file
View File

@@ -0,0 +1,15 @@
// rabbit.ts
class Rabbit {
name: string;
constructor(name: string) {
this.name = name;
}
}
let myName: string = "Monty";
let r: Rabbit = new Rabbit("Python");
console.log(r.name); // ERROR!!!
console.log(myName); // Prints "Python"