My object all sublime I shall achieve in time. W. S. Gilbert
My object all sublime I shall achieve in time.
W. S. Gilbert
Is it a world to hide virtues in? William Shakespeare,Twelfth Night
Is it a world to hide virtues in?
William Shakespeare,Twelfth Night
This above all: to thine own self be true. William Shakespeare, Hamlet
This above all: to thine own self be true.
William Shakespeare, Hamlet
Don't be "consistent," but be simply true. Oliver Wendell Holmes, Jr.
Don't be "consistent," but be simply true.
Oliver Wendell Holmes, Jr.
In this chapter you will learn:
What class scope is and how it affects access to class members.
To create overloaded constructors that can initialize objects of a class in a variety of ways.
To use partial classes to enable one class to span multiple source-code files.
How composition enables you to construct classes that are "made out of" other classes.
To use Me to refer to the current object's members.
How garbage collection eliminates most "memory leaks."
How Shared class variables help conserve memory.
How to create constant members with Const (at compile time) and ReadOnly (at runtime).
To use the Object Browser to discover the capabilities of the classes in the Framework Class Library (FCL).
Outline
9.1 Introduction9.2 Time Class Case Study9.3 Class Scope9.4 Default and Parameterless Constructors9.5 Time Class Case Study: Overloaded Constructors9.6 Partial Classes9.7 Composition9.8 Using the Me Reference to Access the Current Object9.9 Garbage Collection9.10 Shared Class Members9.11 Const and ReadOnly Members9.12 Object Browser9.13 Time Class Case Study: Creating Class Libraries9.14 (Optional) Software Engineering Case Study: Starting to Program the Classes of the ATM System9.15 Wrap-Up
9.1 Introduction
9.2 Time Class Case Study
9.3 Class Scope
9.4 Default and Parameterless Constructors
9.5 Time Class Case Study: Overloaded Constructors
9.6 Partial Classes
9.7 Composition
9.8 Using the Me Reference to Access the Current Object
9.9 Garbage Collection
9.10 Shared Class Members
9.11 Const and ReadOnly Members
9.12 Object Browser
9.13 Time Class Case Study: Creating Class Libraries
9.14 (Optional) Software Engineering Case Study: Starting to Program the Classes of the ATM System
9.15 Wrap-Up