Cannot reduce the visibility of the inherited method from Interface解决办法

报错:Cannot reduce the visibility of the inherited method from Interface

原因:子类方法的访问权限低于基类该方法的访问权限。

解决办法:调整子类方法的访问权限大于或等于基类的访问权限。

解释:如果允许子类方法降低父类方法的权限,当通过父类引用调用子类方法时,将掩盖掉该错误(子类方法访问权限较低)。这种思想将引起大量错误的出现。

猜你喜欢

转载自blog.csdn.net/qq_34579060/article/details/80974913