The .NET WeakReference Class represents a weak reference, which references an object while still allowing that object to be reclaimed by garbage collection. Now, let's see an example. Create a console application from Visual Studio and name it MyWeakReference.
Create a WeakReference object and pass an object reference to the constructor call. In the following example, I have used the StringBuilder object.
No comments:
Post a Comment