Ejemplo n.º 1
0
        static void Main()
        {
            Student stu = null;

            if (StudentFactory.Create("Tim", 23, out stu))
            {
                Console.WriteLine("Student {0},age is {1}.", stu.Name, stu.Age);
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Student stu = null;
            bool    b   = StudentFactory.Create("Tim", 23, out stu);

            if (b == true)
            {
                Console.WriteLine("Student {0}, age is {1}.", stu.Name, stu.Age);
            }
        }