class P{
public:
void x(){
}
}
class S : public P{
void y(){
x(); // 报错
this->x(); // 正确
}
}
我发现在子类函数中调用父类的方法, 即使没有发生名字覆盖或者虚函数改写, 感觉有点奇怪啊.. 还有继承自父类的属性, 也是这样...
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
不需要呀
报了什么错?