static void Main() { Person firstPerson = new Person("Rosen", 56); Person secondPerson = new Person("Petar"); Console.WriteLine(firstPerson.ToString()); Console.WriteLine(secondPerson.ToString()); }
static void Main(string[] args) { //testing Person samplePerson = new Person("xxx",5); Console.WriteLine(samplePerson); samplePerson = new Person("xxx"); Console.WriteLine(samplePerson); }
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); }