Example #1
0
        static void Main()
        {
            Person firstPerson = new Person("Rosen", 56);
            Person secondPerson = new Person("Petar");

            Console.WriteLine(firstPerson.ToString());
            Console.WriteLine(secondPerson.ToString());
        }
Example #2
0
        static void Main(string[] args)
        {
            //testing


            Person samplePerson = new Person("xxx",5);
            Console.WriteLine(samplePerson);
            samplePerson = new Person("xxx");
            Console.WriteLine(samplePerson);
        }
Example #3
0
        static void Main()
        {
            //Create new person and print on console
            Person testPerson = new Person("Nakov");
            Console.WriteLine(testPerson);

            //Set explicitly age to null and print result
            testPerson.Age = null;
            Console.WriteLine(testPerson);

            //Set age with real number
            testPerson.Age = 30;
            Console.WriteLine(testPerson);
        }