static void Main(string[] args) { Person newPerson = new Person("Ivan Ivanov Ivanov", 28, "*****@*****.**"); Person newPerson1 = new Person("Dragan Petrov Ivanov", 28); Person.ToString(newPerson); Console.WriteLine(); Person.ToString(newPerson1); }
public static void ToString(Person person) { Console.WriteLine("Name: {0}", person.Name); Console.WriteLine("Age: {0}", person.Age); Console.WriteLine("Email: {0}", person.Email); }