相关疑难解决方法(0)

Delphi中"严格私有"和"受保护"访问修饰符之间的区别?

但是我学习编程,在用Pascal语言进行结构化编程之后,我开始用Delphi学习OOP.

所以,我真的不明白strict private指令和那个指令之间的区别protected.所以这是我的代码,它是关于"包"的创建,它只是我的Delphi课程的介绍,老师告诉我们如何创建对象:

    uses
  SysUtils;

Type

  Tbag= class (Tobject)                                                          
    strict private                                                                
      FcontenM : single;
      Fcontent : single;
    protected
      function getisempty : boolean;
      function getisfull: boolean;
    public
      constructor creer (nbliters : single);
      procedure add     (nbliters : single);
      procedure clear   (nbliters : single);
      property contenM : single read FcontenM;
      property content : single read Fcontent;
      property isempty : boolean read getisempty;
      property isfull : boolean read getisfull;
    end;


function Tseau.getisempty;
  begin
    result := Fcontent = 0;
  end;

function …
Run Code Online (Sandbox Code Playgroud)

delphi access-modifiers

19
推荐指数
4
解决办法
1万
查看次数

标签 统计

access-modifiers ×1

delphi ×1