generate functionThu, 22 Dec 2022

add to this class a copy constructor class Person { private String name; private int age; public Person(string name, int age) { this.name = name; this.age = age; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; }

public Person(Person other) { this.name = other.name; this.age = other.age; } class Program { static void Main(string[] args) { Person p = new Person("mark", 22); Person p2 = new Person(p); } }

Questions about programming?Chat with your personal AI assistant