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

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

angularjs - ng-repeat duplicating items after page reload -