python 並沒有private 這種東西,只能透過命名的方式希望不要讓別人存取.而命名方式就是在變數或方法前面加上 _ . >>> class Animal: ... age = 0 ... def ...
確定! 回上一頁