O'Reilly logo

Microsoft® .NET Compact Framework (Core Reference) by Mark Sutton, Rory MacLoed, Robert Burbidge, Stephen Wheelwright, Andy Wigley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with Class Objects

The .NET Framework is entirely object-oriented. There are some points worth reinforcing about working with class objects within the .NET Framework, chiefly object construction and destruction, how callbacks work, and using delegates and events.

Constructors and Finalizers

In most cases, you create objects by creating new instances of a class using the new keyword, and you do not explicitly delete those objects. Instead, you rely on the .NET Compact Framework garbage collector to detect when the object becomes unreferenced and to delete the unreferenced object, freeing up memory. An object becomes unreferenced when no other classes or applications need the object. Consider the following C# example:

Public void MyMethod() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required