Yurttas/PL/OOL/CS/F/03/00/01/B01.cs
Jump to navigation
Jump to search
1/**
2 * Copyright(C) 2003
3 * All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
4 *
5 * Permission to use, copy, modify, and distribute this
6 * software and its documentation for EDUCATIONAL purposes
7 * and withConsole fee is hereby granted provided that this
8 * copyright notice appears in all copies.
9 *
10 * @date : September 1, 2003.
11 * @author : Salih Yurttas.
12 */
13
14
15public class B01
16{
17 public static void Main(string[] args)
18 {
19 System.Console.WriteLine("b0 /");
20 B b0 = new B();
21 System.Console.WriteLine();
22
23 System.Console.WriteLine("b0 /");
24
25 // you can qualify only by class name
26 // no instance variable can be used for static members
27 System.Console.WriteLine(B.i0);
28 System.Console.WriteLine();
29
30 System.Console.WriteLine(b0.i1);
31 ++b0.i1;
32 System.Console.WriteLine(b0.i1);
33 System.Console.WriteLine();
34
35 System.Console.WriteLine("b1 /");
36 B b1 = new B();
37 System.Console.WriteLine();
38
39 // you can qualify only by class name
40 // no instance variable can be used for static members
41 System.Console.WriteLine(B.i0);
42 System.Console.WriteLine();
43
44 System.Console.WriteLine(b1.i1);
45 ++b1.i1;
46 System.Console.WriteLine(b1.i1);
47 System.Console.WriteLine();
48
49 System.Console.WriteLine("b2 /");
50 B b2 = new B();
51 System.Console.WriteLine();
52
53 // you can qualify only by class name
54 // no instance variable can be used for static members
55 System.Console.WriteLine(B.i0);
56 System.Console.WriteLine();
57
58 System.Console.WriteLine(b2.i1);
59 ++b2.i1;
60 System.Console.WriteLine(b2.i1);
61 System.Console.WriteLine();
62 }
63}