我在一个单元文件中声明了几个类。
type
TFather=Class(TObject)
private
i,j:integer;
public
procedure seti;
procedure setj;
// Function Add:integer;
Constructor Create;
end;type
TChild1=Class(TFather)
end;
type
TChild2=Class(TFather)
end;
在TFather类中i,j已经被声明为Private,但我在后面调用类TChild1和TChild2时仍然可以访问i,j,不是不能访问私有成员吗?
type
TFather=Class(TObject)
private
i,j:integer;
public
procedure seti;
procedure setj;
// Function Add:integer;
Constructor Create;
end;type
TChild1=Class(TFather)
end;
type
TChild2=Class(TFather)
end;
在TFather类中i,j已经被声明为Private,但我在后面调用类TChild1和TChild2时仍然可以访问i,j,不是不能访问私有成员吗?
在同一个单元里定义的都是友类.