In that example, your class "A" does not need to implement IDisposable: it does not contain anything which needs to be Disposed.
However, it is simple enough to do: MSDN does provide a guid which shows you how to do it properly
Implement IDisposable[
^]
You title however is not correct - setting a reference to
null
does not do the same thing as Disposing of a class instance, and it in no way does anything "better". If you use scarce resources in your class and do not implement IDisposable, then setting the reference to
null
does not release those resources - they remain in use until the Garbage Collector is called in and removes class instance, and frees it's resources - which may not happen for a very, very long time, and it is only normally triggered when memory is running low, not resources.
For example, if your class opens a file in it's constructor, and closes it in it's Dispose method, then setting the reference to
null
will leave the file open and in use until the Garbage Collector destroys your class instance. Until then, nothing inside or outside your application can access the file.