标签:ext txt 无法 xtend vat ble 代码 public nts
若使用protected限制父类的方法,则该方法仅父类和子类内部(即定义父类和子类的代码中)可以调用
无法通过对象进行调用。类似的 private 定义的方法只能在本身的代码中使用。
public class Emplogee implements Cloneable{ protected void protext(){ } } public class Manager extends Emplogee { public void mantxt(){ protext(); } } public void test(){ Manager m = new Manager(); Emplogee e = new Emplogee(); e.pro... 无法调用 m.pro... 无法调用 }
标签:ext txt 无法 xtend vat ble 代码 public nts
原文地址:https://www.cnblogs.com/pihaochen/p/11173360.html