mother对象如何在调用类型为son时能够调用father的函数? 这里的father对象没有创建,那么如何来调用drive()函数。对于新手的问题抱歉。 #include <iostream>
using namespace std;
#include <iostream>
using namespace std;
class father
{
public:
下面的代码: class A1 {
public:
int x;
};
class A2 {
private:
int x() { return 67; }
};
class M : public A1, public A2 {};
int main() {
M m;
m.x;
}
编译错误: error C2385: ambiguo
正如How does Python's super() work with multiple inheritance?中所解释的,super也可用于多继承,因为它将在父代中查找属性。但是什么属性?子类已经包含一个super(如果你看下面的代码)。我如何指定我想要的属性?我想要Error的构造函数。 class Error(object):
def __init__(self, value
我们可以称这个代码为多继承吗? interface Interface {
public int alpha = 0;
public int calculA(int a, int b);
public int calculB(int a, int b);
}
interface InterfaceA extends Interface {
publ