Multiple choice technology programming languages

How do you Dereference an Object in VB.NET

  1. By setting the object to Null

  2. By setting the object to Nothing

  3. With Close keyword

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In VB.NET, objects are dereferenced and released for garbage collection by setting them to the Nothing keyword. Null is not used in VB.NET (unlike C#'s null), and Close terminates a connection or stream but does not dereference the object reference variable.