static void Main()
        {
            var personFirst = new Person("Ivan Ivanov", 25);
            var personSecond = new Person("Nevena Nevenova");

            Console.WriteLine("{0}\n{1}", personFirst, personSecond);
        }
        public static void Main()
        {
            Person person = new Person("Pesho");
            Console.WriteLine(person.ToString());

            Person secondPerson = new Person("Gosho", 25);
            Console.WriteLine(secondPerson.ToString());
        }
        static void Main()
        {
            Person Pesho = new Person("Pesho", 19);
            Person Gosho = new Person("Gosho");

            Console.WriteLine(Pesho);
            Console.WriteLine(Gosho);
        }
        static void Main(string[] args)
        {
            var testPerson1 = new Person(28, "Pesho");
            var testPerson2 = new Person("Georgi");

            Console.WriteLine(testPerson1);
            Console.WriteLine(testPerson2);
        }
Beispiel #5
0
        private static void Main()
        {
            var pesho = new Person("Pesho");
            Console.WriteLine(pesho);

            var gosho = new Person("Gosho", 23);
            Console.WriteLine(gosho);
        }
        public static void Main()
        {
            Person stamat = new Person("Stamat",22);
            Person sharo = new Person("Sharo");

            Console.WriteLine(stamat);
            Console.WriteLine(sharo);
        }
        static void Main()
        {
            Person pesho = new Person("Pesho");
            Person aivan = new Person("Aivan",43);

            Console.WriteLine(pesho.ToString());
            Console.WriteLine(aivan.ToString());
        }
        static void Main()
        {
            Person rado = new Person("Gosho", 16);
            Person radorado = new Person("GoshoGosho", null);

            Console.WriteLine(rado.ToString());
            Console.WriteLine(radorado.ToString());
        }
        static void Main()
        {
            Person pesho = new Person("Pesho", 20);
            Person gosho = new Person("Gosho");

            Console.WriteLine(pesho.ToString());
            Console.WriteLine(gosho.ToString());
        }
        static void Main()
        {
            Person person = new Person("Ivan Ivanov", 25);
            Person personNoAge = new Person("Galin Petrov");

            Console.WriteLine(person);
            Console.WriteLine(personNoAge);
        }
        static void Main(string[] args)
        {
            Person personOne = new Person("Pesho Gosho", 30);
            Person personTwo = new Person("Ivan");

            Console.WriteLine(personOne);
            Console.WriteLine();
            Console.WriteLine(personTwo);
        }
        static void Main()
        {
            Person pesho = new Person("Pesho"); //new Person("Pesho",5);

            Console.WriteLine(pesho.Age);

            Console.WriteLine("Pesho info:");
            Console.WriteLine();
            Console.WriteLine(pesho.ToString());
        }
        static void Main()
        {
            var person1 = new Person("Stefcho", 12);

            Console.WriteLine(person1);

            var person2 = new Person("Dracula");

            Console.WriteLine(person2);
        }
        /* Create a class Person with two fields – name and age. Age can be left unspecified
           (may contain null value. Override ToString() to display the information of a person
           and if age is not specified – to say so.
           Write a program to test this functionality.
         */
        public static void Main()
        {
            var person = new Person("Ivan Peshev", 12);

            Console.WriteLine(person);

            var otherPerson = new Person("Pesho Ivanov");

            Console.WriteLine(otherPerson);
        }
        static void Main(string[] args)
        {
            Person p1 = new Person("Peshko", 4);
            Person p2 = new Person("Goshko");

            Console.WriteLine("--- Person 1 ---");
            Console.WriteLine(p1);
            Console.WriteLine();
            Console.WriteLine("--- Person 2 ---");
            Console.WriteLine(p2);
        }
        public static void Main()
        {
            Person firstMale = new Person();
            firstMale = firstMale.MakePerson(2);
            Console.WriteLine(firstMale.Name);
            Console.WriteLine(firstMale.Gender);

            Person secondFemale = new Person();
            secondFemale = secondFemale.MakePerson(3);
            Console.WriteLine(secondFemale.Name);
            Console.WriteLine(secondFemale.Gender);
        }
        public static void Main()
        {
            var person = new Person("Ivan", null);

            var otherPerson = new Person("Pencho", 22);

            var anotherPerson = new Person("Gosho");

            Console.WriteLine(person);
            Console.WriteLine(otherPerson);
            Console.WriteLine(anotherPerson);
        }
 static void Main()
 {
     Console.WriteLine("Person with defined only name: ");
     Console.WriteLine(new string('-', 30));
     Person firstPerson = new Person("Ivan Ivanov");
     Console.WriteLine(firstPerson);
     Console.WriteLine();
     Console.WriteLine("Person with defined name and age: ");
     Console.WriteLine(new string('-', 33));
     Person secondPerson = new Person("Stefaniya Stefanova", 25);
     Console.WriteLine(secondPerson);
 }
Beispiel #19
0
        public static void Main()
        {
            Person firstPerson = new Person();
            firstPerson.Name = "Albena";
            firstPerson.Age = 23;

            Person secondPerson = new Person();
            secondPerson.Name = "Ivaylo";
            secondPerson.Age = null;

            Console.WriteLine(firstPerson);
            Console.WriteLine(secondPerson);
        }
Beispiel #20
0
        static void Main()
        {
            Person joro = new Person("Joro Peshov", 25);
            Person agelessPerson = new Person("Pesho Peshev");
            Person namelessPerson = new Person(15);
            Person empty = new Person();

            Console.WriteLine("Creating Persons with all combinatios of available data and printing them:");
            Console.WriteLine(joro);
            Console.WriteLine(agelessPerson);
            Console.WriteLine(namelessPerson);
            Console.WriteLine(empty);
        }
        public static void Main()
        {
            var person = new Person("Billy");
            Console.WriteLine(person.ToString());

            Console.WriteLine();

            var someOtherPerson = new Person("Wayne", null);
            Console.WriteLine(someOtherPerson);

            Console.WriteLine();

            var otherPerson = new Person("Simon", 30);
            Console.WriteLine(otherPerson);
        }
        public static void Main()
        {
            Person[] persons = new Person[]
            {
                new Person("Pesho Peshev", 20),
                new Person("Gosho Goshev", 22),
                new Person("Ivo Kenov"),
                new Person("Niki Kostov"),
                new Person("Doncho Minkov"),
                new Person("Evlogi Hristov")
            };

            for (int i = 0; i < persons.Length; i++)
            {
                Console.WriteLine(persons[i]);
            }
        }
Beispiel #23
0
 // метод сравнения объектов
 public new bool Equals(Object obj)
 {
     Person person = (Person)obj;
     return (FirstName == person.FirstName) && 
            (LastName == person.LastName);
 }