class Shape{
    Area:number
    constructor(a:number)
    {
        this.Area = a
    }

    static print():void
    {
        console.log("输出了一段文字")
    }
}

class Circle extends Shape{
    disp():void{
        console.log("圆的面积为:" + this.Area)
    }
}

let cir = new Circle(100)
cir.disp()
Circle.print()

首页 我的博客
粤ICP备17103704号