Pages

Object reference not set to an instance of an object

http://umairaslam.com/index.php/object-reference-not-set-to-an-instance-of-an-object/

2 comments:

  1. Hi Umair,
    I don't think Example 1 might result in Null Reference Exception as 'int' is value type and has some value when you create it. On the other hand if you use a variable of reference type without assigning a reference to it might result in Null Reference Exception

    Thanks,
    Abdullah Atta

    ReplyDelete
  2. Ya agreed good point out , well i just want to clarify that if we use unassign object then it will result for null exception . Good Eye :-)

    ReplyDelete