An Object is an instance of a Class , it is stored some where in memory. A reference is what is used to describe the pointer to the memory location where the Object resides. The message "object reference not set to an instance of an object" (NullReferenceException) means that you are referring to an object the does not exist or was deleted or cleaned up. In order to prevent the error, objects that could be null should be tested for null before being used.if (mClass != null){ // Go ahead and use mClass mClass.property = ...}else{ // Attempting to use mClass here will result in NullReferenceException}A NullReferenceException typically reflects developer error and is thrown in the following scenarios:Forgotten to instantiate a reference type. Forgotten to dimension an array before initializing it. Is thrown by a method that is passed null. Get a null return value from a method, then call a method on the returned type. Using an expression to retrieve a value and, although checking whet
Already have an account? Login
No account yet? Create an account
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.