using System; using System.Threading; // a module used for the ``sleep'' trick below /// TestClock shows a ticking clock. public class TestClock { public static void Main() { int START = 50; // the clock's start time Clock c = new Clock(START); // construct the clock, c while ( true ) { c.tick(); Console.WriteLine(c.getTime()); // This makes the program sleep for 500 milliseconds: Thread.Sleep(500); } // Alas, we _cannot_ do this: // Console.WriteLine(c.time); // This is illegal because variable time in Clock // is _private_ ! } }