class Oya {
    hello() {
        console.log("hello!!");
    }
}

class Kodomo extends Oya {
}

const kodomo = new Kodomo();
kodomo.hello(); 



class Oya {
    hello() {
        return "こんにちは!!";
    }
}



class Kodomo {
    constructor() {
        this.oya = new Oya();
    }

    hello() {
        this.oya.hello();
    }
}

kodomo = new Kodomo();
kodomo.hello();  



class OyaWithArg {
    constructor(arg) {
        console.log(`called with ${arg}`);
    }
}

class KodomoWithArg extends OyaWithArg {
}



new KodomoWithArg(1); 
new KodomoWithArg(); 



[JS]
class Oya {
    constructor() {
        console.log("called Oya");
    }
}

class Kodomo extends Oya {
    constructor() {
        super(); 
        console.log("called Kodomo");
    }
}

new Kodomo(); 



class Oya {
    foo() {
        console.log("Oya foo");
    }
}

class Kodomo {
    foo() {
        super.foo();
        console.log("Kodomo foo");
    }
}

const kodomo = new Kodomo();
kodomo.foo(); 



class Kodomo(Oya1, Oya2, Oya3):
    pass



class OyaWithArg:
    def __init__(self, arg):
        print(f"called with {arg}")


class KodomoWithArg:
    pass



KodomoWithArg(1) 
KodomoWithArg() 



class Oya:
    def __init__(self, name):
        self.name = name
        print(f"Oya {name}")

    def show(self):
        print(self.name)


class Kodomo(Oya):
    def __init__(self, name): 
        print(f"Kodomo {name}")


kodomo = Kodomo("憲剛") 
kodomo.show() 



class Kodomo(Oya):
    def __init__(self, name):
        super().__init__(name)
        print(f"Kodomo {name}")


kodomo = Kodomo("憲剛") 
kodomo.show() 



class A:
    def __init__(self):
        super().__init__()
        print("A")


class B(A):
    def __init__(self):
        super().__init__()
        print("B")


class C:
    def __init__(self):
        print("C")


class D(B, C):
    def __init__(self):
        super().__init__()
        print("D")



D.mro()



class D(B, C):
    def __init__(self):
        super().__init__()
        C.__init__(self) 
        print("D")



class User {
    #name = null;

    set name(name) {
        this.#name = name;
    }

    get name() {
        return this.#name;
    }
}

const user = new User();
user.name = "憲剛";
user.name; 



class User {
    #name = null;

    set name(name) {
        console.log("call setter");
        this.#name = name;
    }

    get name() {
        console.log("call getter");
        return this.#name;
    }
}

const user = new User();
user.name = "憲剛"; 
user.name;



class User:
    def get_name(self):
        return self.__name

    def set_name(self, name):
        self.__name = name

    name = property(get_name, set_name)


user = User()
user.name = "憲剛"
user.name 



class User:
    @property
    def name(self):
        return self.__name

    @name.setter
    def name(self, name):
        self.__name = name


user = User()
user.name = "憲剛"
user.name 


