Example Code Used in This Chapter

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

C# .NET

Counter.cs

using System;using System.Collections.Generic;using System.Text;namespace Counter{    class Counter    {        private int counter;        private static Counter instance = null;        protected Counter()        {        }        public static Counter getInstance()        {            if (instance == null)            {                instance = new Counter();                Console.WriteLine("New Instance of Counter...");            }            return ...

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.