Vote UpVote

Fun Code of the Day #2: Does nil have a type?

Delphi-losophy – Okay, no cheating now. That is, no running the code until you’ve guessed. What is the output of this code?program Project90; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; var S: TObject; begin try S := nil; if S is TObject then begin Writeln('Yup'); end else begin Writeln('Nope'); end; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; Readln; end.How sure are you? Now run it and find out. Were you right?
Favorite? Off-Topic? nickhodges@gmail.com @ 2016-05-15 16:34


Visits: 1722
Votes: 2
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


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