我有一个抽象类,relation在 packagedatabase.relation和它的子类Join,在 package database.operations。relation有一个名为 的受保护成员mStructure。
在Join:
public Join(final Relation relLeft, final Relation relRight) {
super();
mRelLeft = relLeft;
mRelRight = relRight;
mStructure = new LinkedList<Header>();
this.copyStructure(mRelLeft.mStructure);
for (final Header header :mRelRight.mStructure) {
if (!mStructure.contains(header)) {
mStructure.add(header);
}
}
}
在线
this.copyStructure(mRelLeft.mStructure);
和
for (final Header header : mRelRight.mStructure) {
我收到以下错误:
字段 Relation.mStructure 不可见
如果我将两个类放在同一个包中,这将非常有效。谁能解释这个问题?