c# - Difference between: (object) o == null and (((object) o) == null -
i tried check arguments null, , found question in mind: what's difference between:
if ( (object) o == null ) ... and
if ( ((object) o) == null ) ... edit: variable o can of reference type (with overloaded == operator on not).
if ((object) o) == null) ... is mistake. maybe want write
if (((object) o) == null) ... so cast o object test if equals null
it same thing except in if (((object) o) == null) ... made explicitly (human friendly) ()
all these notations accomplish same test.
Comments
Post a Comment