Anonymous user
Null object: Difference between revisions
Updated D entry
(Scala.) |
(Updated D entry) |
||
Line 209:
=={{header|D}}==
In D ''is'' is used
▲In D ''is'' is used for comparing identity, like two objects or an object against null.
▲<lang d>import tango.io.Stdout;
class K {}
if(object is null)▼
void main() {
Stdout.formatln("object is null");▼
K k;
k = new K;
if (k !is null)
writeln("Now k is not null");
}</lang>
{{out}}
<pre>k is null
Now k is not null</pre>
=={{header|Delphi}}==
|