コード例 #1
0
        public static MyClass operator +(MyClass a, MyClass b)
        {
            MyClass result = new MyClass();

            return(result);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: rahulnagaich/MyConsoleApp
        static void Main(string[] args)
        {
            MyClass myClass = new MyClass("");

            Console.WriteLine(myClass.Foo);

            // var objC = new C();
            //A a = objC;
            //a.Test();
            //objC.Test();

            //var cl1 = new Class1();

            //cl1.NewMethod();

            //cl1.NewMethod2(1);

            //XX.NewMethod(cl1);

            //string str = "123456";
            //int num = str.IntegerExtension();
            //Console.WriteLine("The output using extension method: {0}", num);

            //var actions = new List<Action>();
            //for (int i = 0; i < 5; i++)
            //{
            //    Console.WriteLine(i);

            //        actions.Add(
            //        () => Console.WriteLine("fdfdfd   " + i)
            //        );
            //}

            //foreach (var action in actions)
            //    action();

            //bool isComplete = false;

            //var t = new Thread(() =>
            //{
            //    int i = 0;
            //    while (!isComplete) i += 0;
            //});

            //t.Start();

            //Thread.Sleep(500);
            //isComplete = true;
            //t.Join();
            //Console.WriteLine("complete!");

            //class1 a = new class3();
            //class2 b = new class3();
            //class3 c = new class3();
            //Console.WriteLine(a.DoSomething());
            //Console.WriteLine(b.DoSomething());
            //Console.WriteLine(c.DoSomething());

            //int? i = 0;
            //++i;
            //Console.WriteLine("Value of i is {0} ", i);
            //i++;
            //Console.WriteLine("Value of i is {0} ", i);
            //++i;
            //Console.WriteLine("Value of i is {0} ", i);

            //double dVal = 100.1;
            //Console.WriteLine((int)dVal);

            //object objVal = dVal;
            //Console.WriteLine(Convert.ToInt16(objVal));

            //char x = 'X';
            //int i = 0;
            //Console.WriteLine(true ? x : 0);
            //Console.WriteLine(false ? i : x);

            //int x = 1975;
            //int y = 2015;
            //x ^= y ^= x ^= y;
            //Console.WriteLine("x = " + x + "; y = " + y);

            //C Puzzler = null;
            //Console.WriteLine(C.get());

            //Double i = Double.NaN;

            //Console.WriteLine("Hello  " + i);

            //while (i != i)
            //{
            //    Console.WriteLine("Hello  iiiii   " + i);
            //}



            Console.ReadLine();
        }