| 12345678910111213141516171819 |
- (function() {
- // 接口 定义数据类型的规范
- interface vase {
- name: string,
- age1: number
- }
- class Person2 implements vase {
- name:string;
- age1: number;
- color: string;
- constructor(name:string,age:number,color:string) {
- this.name = name;
- this.age1 = age;
- this.color = color;
- }
- }
- let p3 = new Person2('图图',3,'红');
- console.log(p3);
- })()
|