ToString() 공개 메소드

public ToString ( ) : string
리턴 string
예제 #1
0
        public static void Main(string[] args)
        {
            Person personWithAge = new Person("Unufri", 12);
            Person personWithoutAge = new Person("Ani");

            Console.WriteLine(personWithAge.ToString());
            Console.WriteLine(personWithoutAge.ToString());
        }
예제 #2
0
        static void Main(string[] args)
        {
            Person zhivko = new Person("Zhivko", 99, "*****@*****.**");
            Person ivan = new Person("Ivan", 11);

            Console.WriteLine(zhivko.ToString());
            Console.WriteLine(ivan.ToString());
        }
예제 #3
0
        static void Main()
        {
            Person person1 = new Person("Nashmat", 18, "*****@*****.**");
            Console.WriteLine(person1.ToString());

            Person person2 = new Person("Onufrey", 21);
            Console.WriteLine(person2.ToString());

            //Person person3 = new Person("Mircho", 101);
            //Console.WriteLine(person3.ToString());
        }
        public static void Main(string[] args)
        {
            Console.Write("Please, enter a name: ");
            var name = Console.ReadLine();
            Console.Write("Please, enter a a value for age: ");
            var age = int.Parse(Console.ReadLine());
            Console.Write("Please, enter an email: ");
            var email = Console.ReadLine();

            Person firstPerson = new Person(name, age, email);
            //Person secondPerson = new Person("Stoqn", 22);

            Console.WriteLine(firstPerson.ToString());
            //Console.WriteLine(secondPerson.ToString());
        }
예제 #5
0
파일: MainProgram.cs 프로젝트: T316/OOP
 static void Main()
 {
     Person pesho = new Person("Pesho", 22, "*****@*****.**");
     Console.WriteLine(pesho.ToString());
 }
        public static void Main()
        {
            var person = new Person("Joe", 25, "*****@*****.**");

            Console.WriteLine(person.ToString());
        }