コード例 #1
0
        /// <summary>
        /// Main.
        /// </summary>
        /// <param name="args">Command-Line Args</param>
        static void Main(string[] args)
        {
            Person person = new Person("Aa", "Aaa", 20);
            Person personB = new Person("Bb", "Bbb", 300);
            Person personC = new Person("Cc", "Ccc", 5);

            person.PrintFullName();
            personB.PrintFullName();
            personC.PrintFullName();

            PersonCollection personCollection = new PersonCollection();

            personCollection.AddPerson(person);
            personCollection.AddPerson(new Person("Not", "Declared First", 34));

            Console.WriteLine(personCollection.GetPersonCollectionToString());
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: andrejs201/cis237Inclass1
        static void Main(string[] args)
        {
            Person person = new Person("Andrejs", "Tomsons", 23);
            Person person2 = new Person("Joe", "Somebody", 85);

            person.PrintFullName();
            person2.PrintFullName();
            person.PrintFullName();

            PersonCollection personCollection = new PersonCollection();

            personCollection.AddPerson(person);
            personCollection.AddPerson(new Person("Not", "Declared First", 34));

            Console.WriteLine(personCollection.GetPersonCollectionToString());
            Console.WriteLine("Branching demo");
            Console.WriteLine("Another line");

            Console.WriteLine("Different things");
            Console.WriteLine("More Different things");
        }