Exemplo n.º 1
0
        static void Main(string[] args)
        {
            //This is a block
            float width  = 20.0f;
            float height = 30.0f;
            float area   = 0.0f;

            {
                area = width * height;
            }
            Console.WriteLine("Area = {0}", area);
            int x1 = 2;
            int a  = x1++;

            Console.WriteLine("a = {0}", a);
            byte x3 = 255;

            unchecked {
                byte x4 = (byte)(x3 + 3);
                Console.WriteLine("x4 = {0}", x4);
            }
            int c = 10;
            int d = 3;

            Console.WriteLine("thuong = {0}", (float)c / (float)d);
            Something something = new Something();

            something.x = 99;
            doSomething(something);
            Console.WriteLine("xx = {0}", something.x);
            int yy = 111;

            //     doSomething2(yy);
            Console.WriteLine("yy = {0}", yy);
            //BaiTapNgay23092020();
            //MenuExample();
            Car c1 = new Car("Mazda", 1233);

            c1.Name = "Honda"; //c1.setName("Honda"); trong Java
        }
Exemplo n.º 2
0
 static void doSomething(Something something)
 {
     something.x = 120;
 }