zoukankan      html  css  js  c++  java
  • DELPHI类声明方式简介

     1 TMyDemo = class(TObject)
     2     FName: string; {数据成员(Field)}
     3     FAge: Integer;
     4   private   {私有的}   {最为隐秘的访问程度}
     5     procedure SetAge(Value: Integer);
     6   protected {受保护的} {中等程度的访问能力}
     7     procedure IAmAStatic;                             {静态方法}
     8     procedure IAmAVirtual; virtual;                   {虚方法}
     9     procedure IAmADynamic; dynamic;                   {动态方法}
    10     procedure IAmAVirtualAbstract; virtual; abstract; {抽象虚方法}
    11   public    {共有的}   {最大程度的访问能力}
    12     constructor Create;                                      {构造方法(函数)}
    13     destructor Destroy;                                      {析构方法(函数)}
    14     class procedure ShowTest;                                {类方法<方法前加class>}
    15     procedure Test_1;                                        {过程}
    16     function Test_2: Integer;                                {函数}
    17     procedure WMChar(var message: TWMChar); message WM_CHAR; {消息处理方法}
    18   published {公布的}   {最大程度的访问能力} {可见属性}
    19     property Name: string read FName write FName; {属性(property)}
    20     property Age: Integer read FAge write SetAge; {属性(property)}
    21     property Coms stored False; // 默认值<待测试>
    22   automated {自动的}
    23     // 基本不用
    24   end;
  • 相关阅读:
    ryzen nvidia hackintosh
    mysql count 主键之坑
    git命令
    MYSQL 注释
    yaf twig配置
    1.YAF 的安装
    yaf nginx 设置
    ubuntu 16 阿里云 vsftpd
    win10下 homestead 安装
    活动调度
  • 原文地址:https://www.cnblogs.com/BlackList-Sakura/p/5736439.html
Copyright © 2011-2022 走看看