示例#1
0
 public void ThrowException(ObjTypes obj)
 {
     if (obj == null)
     {
         throw new System.ArgumentException("Obj cannot be null");
     }
 }
示例#2
0
        static void Main(string[] args)
        {
            Coordinate point = new Coordinate(100, 100, 100);

            Console.WriteLine("Press any key to continue (AddCoordinate)");
            Console.ReadKey();
            ObjTypes ob = new ObjTypes();

            ob.AddCoordinate(point);

            Console.WriteLine("Press any key to continue (Arrays)");
            Console.ReadKey();
            ob.PrintArrays();

            Console.WriteLine("Press any key to continue (Generics)");
            Console.ReadKey();
            Comparer <int> c = new Comparer <int>();

            Console.WriteLine("Greater {0}", c.GreaterThan(5, 10));

            Console.WriteLine("Press any key to continue (Exception)");
            Console.ReadKey();
            ob.ThrowException(null);
        }