Beispiel #1
0
    static void Main()
    {
        // Call the constructor that has no parameters.
        var person1 = new classes.Person();

        Console.WriteLine(person1.Name);

        // Call the constructor that has one parameter.
        var person2 = new classes.Person("Sarah Jones");

        Console.WriteLine(person2.Name);
        // Get the string representation of the person2 instance.
        Console.WriteLine(person2);

        Console.WriteLine("Press any key to exit.");
        Console.ReadKey();
    }