Skip to content

Instantly share code, notes, and snippets.

@freeonterminate
Last active April 19, 2017 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freeonterminate/350924bfc542202c40a3cd4b7aa35ee6 to your computer and use it in GitHub Desktop.
Save freeonterminate/350924bfc542202c40a3cd4b7aa35ee6 to your computer and use it in GitHub Desktop.
Delphi's static method override
program StaticOverride;
type
TFoo = class
public
class procedure Bar; virtual;
end;
TBar = class(TFoo)
public
class procedure Bar; override;
end;
class procedure TFoo.Bar;
begin
Writeln(Self.ClassName);
end;
class procedure TBar.Bar;
begin
Writeln(Self.ClassName);
end;
begin
TFoo.Bar;
TBar.Bar;
Readln;
end.
出力結果:
TFoo
TBar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment