Abstract
Classes are the heart of any application in an object-oriented language. This chapter is broken into several sections. The first section describes the parts of C# that will be used often, and the later sections describe things that won’t be used as often, depending on what kind of code is being written.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Reference
For those of you used to pointers, a reference is a pointer that you can only assign to and dereference.
The garbage collector used in the.NET Runtime is discussed in Chapter 36, “Deeper into C#.”
If you were really going to implement your own point class, you’d probably want it to be a value type (struct) rather than a reference type (class).
From the perspective of other.NET languages, there is no difference between ref and out parameters. A C# program calling this function will see the parameters as out parameters, but other languages will see them as ref parameters.
This function may look like a C++ copy constructor, but the C# language doesn’t use such a concept. A constructor such as this must be called explicitly.
Rights and permissions
Copyright information
© 2001 Eric Gunnerson
About this chapter
Cite this chapter
Gunnerson, E. (2001). Classes 101. In: A Programmer’s Introduction to C#. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-0909-6_5
Download citation
DOI: https://doi.org/10.1007/978-1-4302-0909-6_5
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-893115-62-0
Online ISBN: 978-1-4302-0909-6
eBook Packages: Springer Book Archive