编辑代码

namespace person{
    class family{
        father: string;
        mother: string;

        constructor(father: string = "dad", mother: string = "mam"){
            this.father = father;
            this.mother = mother;
        }

        show(): void{
            console.log("father:" + this.father + ", mother:" + this.mother)
        }
    }

    function showfamily(){
        let family_obj = new family("my_father","my_mother");
        family_obj.show();
    }

}