Example Code Used in This Chapter

The following code is presented in C# .NET. Code for other languages, such as VB .NET and Objective-C, are available electronically on the publisher’s website. These examples correspond to the Java code that is listed inside the chapter itself.

The TestNumber Example: C# .NET

using System;namespace TestNumber{    class Program    {        public static void Main()        {            Number number1 = new Number();            Number number2 = new Number();            Number number3 = new Number();        }    }    public class Number    {        int count = 0;     // available to both method1 and method2        public void method1()        {            count = 1;        }        public ...

Get The Object-Oriented Thought Process, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.