Msn web hosting - Chapter 8 Object-Based Programming 281 Outline 8.1 Introduction

Chapter 8 Object-Based Programming 281 Outline 8.1 Introduction 8.2 Implementing a Time Abstract Data Type with a Class 8.3 Class Scope 8.4 Controlling Access to Members 8.5 Initializing Class Objects: Constructors 8.6 Using Overloaded Constructors 8.7 Properties 8.8 Composition: Objects References as Instance Variables of Other Classes 8.9 Using the this Reference 8.10 Garbage Collection 8.11 static Class Members 8.12 const and readonly Members 8.13 Indexers 8.14 Data Abstraction and Information Hiding 8.15 Software Reusability 8.16 Namespaces and Assemblies 8.17 Class View and Object Browser Summary Terminology Self-Review Exercises Answers to Self-Review Exercises Exercises 8.1 Introduction In this chapter, we investigate object orientation in C#. Some readers might ask, why have we deferred this topic until now? There are several reasons. First, the objects we build in this chapter partially are composed of structured program pieces. To explain the organization of objects, we needed to establish a basis in structured programming with control structures. We also wanted to study methods in detail before introducing object orientation. Finally, we wanted to familiarize readers with arrays, which are C# objects. In our discussions of object-oriented programs in Chapters 1 7, we introduced many basic concepts (i.e., object think ) and terminology (i.e., object speak ) that relate to C# object-oriented programming. We also discussed our program-development methodology: We analyzed typical problems that required programs to be built and determined what classes from the .NET Framework Class Library were needed to implement each program. We then selected appropriate instance variables and methods for each program and specified the manner in which an object of our class collaborated with objects from the .NET Framework classes to accomplish the program s overall goals. Let us briefly review some key concepts and terminology of object orientation. Object orientation uses classes to encapsulate (i.e., wrap together) data (attributes) and methods (behaviors). Objects have the ability to hide their implementation from other objects (this
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.

Leave a Reply