PART I
C h a p t e r 1 6 :
N a m e s p a c e s , t h e P r e p r o c e s s o r , a n d A s s e m b l i e s
441
PART IPART I
}
}
class NSDemo2 {
static void Main() {
// This is CountDown in the Counter namespace.
Counter.CountDown cd1 = new Counter.CountDown(10);
// This is CountDown in the Counter2 namespace.
Counter2.CountDown cd2 = new Counter2.CountDown();
int i;
do {
i = cd1.Count();
Console.Write(i + " ");
} while(i > 0);
Console.WriteLine();
cd2.Count();
}
}
The output is shown here:
10 9 8 7 6 5 4 3 2 1 0
This is Count() in the Counter2 namespace.
As the output confirms, the
Do'stlaringiz bilan baham: |