62,614
社区成员
发帖
与我相关
我的任务
分享
package workplace;
public class ProtectedFunc {
protected void eat(){
System.out.println("eat something");
}
}
import workplace.*;
class Abc extends ProtectedFunc{
void eat(String s) {
super.eat();
System.out.println(s + "abc");
}
public static void main(String[] args) {
Abc a = new Abc();
a.eat();
ProtectedFunc p = new ProtectedFunc();
p.eat();
}
}