generate functionThu, 22 Dec 2022

define class with two properties name as string age as int build get and set methods. regular build class method and a copy type method use old way of get and set

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace class_practice { class Program { static void Main(string[] args) { person person = new person(); person.setname("kimber"); person.setage(21); Console.WriteLine("name is: " +person.getname() + " age is: " + person.getage()); person person2 = new person(); person2.setname("Juan"); person2.setage(22); Console.WriteLine("name is: " + person2.getname() + " age is: " + person2.getage()); Console.ReadLine(); } } public class person { public string name { get; set; } public int age { get; set; } public string getname() { return this.name; } public

Questions about programming?Chat with your personal AI assistant