'title' has private access in 'test.Item'

报错'title' has private access in 'test.Item'
父类中的titleprivate的,子类可以通过super()传递过去,但是不能访问。
如果需要打印title,应该在父类中新建print()方法,然后在子类中打印super.print().

posted @ 2020-05-07 18:20  半羽  阅读(1501)  评论(0)    收藏  举报