コード例 #1
0
        static void Main(string[] args)
        {
            StaticVar s1 = new StaticVar();
            StaticVar s2 = new StaticVar();

            s1.count();
            s1.count();
            s1.count();

            s2.count();
            s2.count();
            s2.count();

            Console.WriteLine("Variable num for s1: {0}", s1.getNum());
            Console.WriteLine("Variable num for s2: {0}", s2.getNum());
            Console.WriteLine("Variable number for s1: {0}", s1.getNumber());
            Console.WriteLine("Variable number for s2: {0}", s2.getNumber());

            StaticVar s3 = new StaticVar();

            s3.count();
            Console.WriteLine("Variable num for s2: {0}", s3.getNum());
            Console.WriteLine("Variable number for s3: {0}", s3.getNumber());
            Console.ReadKey();
        }
コード例 #2
0
ファイル: review.cs プロジェクト: KowalikMichal/Review
        static void Main(string[] args)
        {
            StaticVar s1 = new StaticVar();

            var jsonob = false;

            Console.WriteLine(jsonob.GetType());
            Console.WriteLine(5 & 2);

            s1.count();
            s1.count();
            s1.count();
            StaticVar s2 = new StaticVar();

            s2.count();
            s2.count();
            s2.count();

            Console.WriteLine("Variable num for s1: \n {0}", s1.getNum());
            Console.WriteLine("Variable num for s2: \r {0}", s2.getNum());
            Console.ReadKey();

            /*
             * infinite loop
             * for (; ; ) {
             * Console.WriteLine("Hey! I am Trapped");
             * }
             */
        }
コード例 #3
0
        static void Main(string[] args)
        {
            StaticVar s = new StaticVar();

            s.count();
            s.count();
            s.count();
            Console.WriteLine("变量num: {0}", StaticVar.getNum());
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: jiayu-daemon/C-learning
        static void Main(string[] args)
        {
            StaticVar s = new StaticVar();

            s.count();
            s.count();
            s.count();
            // Console.WriteLine("变量 num: {0}", s.getNum()); 这种写法是错误的
            Console.WriteLine("变量 num: {0}", StaticVar.getNum());
            Console.ReadKey();
        }
コード例 #5
0
        static void Main(string[] args)
        {
            StaticVar s1 = new StaticVar();
            StaticVar s2 = new StaticVar();

            s1.count();
            s1.count();
            s1.count();
            s2.count();
            s2.count();
            s2.count();
            Console.WriteLine("s1 的变量num:{0}", s1.getNum());
            Console.WriteLine("s2 的变量num:{0}", s2.getNum());
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: DanielHang/Training
 static void Main(string[] args)
 {
     StaticVar s1 = new StaticVar();
     StaticVar s2 = new StaticVar();
     s1.count();
     s1.count();
     s1.count();
     s2.count();
     s2.count();
     s2.count();
     Console.WriteLine("Variable num for s1: {0}", s1.getNum());
     Console.WriteLine("Variable num for s2: {0}", s2.getNum());
     Console.WriteLine("Variable num: {0}", StaticVar.getNums());
     Console.ReadKey();
 }