⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sealedandfinal.dpr

📁 source code for Marco Cantu s book Delphi 2007 Handbook
💻 DPR
字号:
program SealedAndFinal;

{%DelphiDotNetAssemblyCompiler '$(SystemRoot)\microsoft.net\framework\v1.1.4322\system.drawing.dll'}

uses
  Borland.Vcl.SysUtils;

type
  TBase = class
    procedure A; virtual;
  end;

  TDeriv1 = class {sealed} (TBase)
    procedure A; override; {final;}
  end;

  // uncomment "sealed" and you'll get the error:
  // "Cannot extend sealed class TDeriv1"

  // uncomment "final" and you'll get the error:
  // "Cannot override a final method"

  TDeriv2 = class (TDeriv1)
    procedure A; override;
  end;


{ TBase }

procedure TBase.A;
begin

end;

{ TDeriv2 }

procedure TDeriv2.A;
begin
  inherited;

end;

{ TDeriv1 }

procedure TDeriv1.A;
begin
  inherited;

end;

begin
  Writeln ('sealed...');
  Readln;
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -