O'Reilly logo

Applied Microsoft® .NET Framework Programming by Jeffrey Richter

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

Chapter 9. Methods

In this chapter, I’ll talk about the different kinds of methods a type can define and the various issues related to methods. Specifically, I’ll show you how to define constructor methods (both instance and type), operator overload methods, and conversion operator methods (for implicit and explicit casting). In addition, I’ll cover how to pass parameters by reference to a method and how to define methods that accept a variable number of parameters. Finally, I’ll explain the virtual method versioning mechanism that exists to stop the potential for application instability when a base class’s programming interface has changed.

Instance Constructors

Constructors are methods that allow an instance of a type to be initialized to a good ...

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