5
votes
Vote UpVote

Static specifier and overriding class methods

The Programming Works – I’ve encountered an interesting problem while overriding virtual class method. Consider the next program: program Project1; {$APPTYPE CONSOLE} uses SysUtils; type TBase = class class function GetName: string; virtual; class procedure Test; static; end; TChild = class(TBase) class function GetName: string; override; end; class function TBase.GetName: string; begin Result:= 'TBase'; end; class procedure TBase.Test; begin Writeln(GetName); end; class function TChild.GetName: string; begin Result:= 'TChild'; end; begin TBase.Test; TChild.Test; ...
Favorite? Off-Topic? Serg @ 2013-07-30 11:15

Statistics

Visits: 891
Votes: 5
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Neonimous
SimaWB
vintagedave
Wouter
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)