Exemplo n.º 1
0
        static void UsePoints()
        {
            try
            {
                var point = new Point(10, 20);
                point.Move(new Point(40, 60));
                Console.WriteLine(" Point is at {0}, {1}", point.X, point.Y);

                point.Move(new Point(100, 200));
                Console.WriteLine(" Point is at {0}, {1}", point.X, point.Y);

                point.Move(null);
            }
            catch (Exception)
            {
                Console.WriteLine("An unexpected error occured.");
            }
        }//end UsePoints
Exemplo n.º 2
0
        static void UsePoints()
        {
            try
            {
                var point = new Point(10, 20);
                point.Move(null);

                System.Console.WriteLine($"{point.X} & {point.Y}");
            }
            catch (System.Exception)
            {
                Console.WriteLine("An Unexpected error occurred");
            }
        }