@@ -0,0 +1,965 @@
+//Program concept -%3E Copying the values of one object into another using constructors%0A%0Aclass Stud%7B%0A%09static String schoolname = %22SFX High%22;%0A%09int id;%0A%09String name;%0A%09String div;%0A%09int age;%0A%09%0A%09Stud(int n, String p, String d, int a)%7B%0A%09%09id = n;%0A%09%09name = p;%0A%09%09div = d;%0A%09%09age = a;%0A%09%7D%0A%09%0A%09//Constructor where the Obj as a parameter.%0A%09//Overloading principles apply.%0A%09Stud(Stud s)%0A%09%7B%0A%09%09id = s.id;%0A%09%09name = s.name;%0A%09%09div = s.div;%0A%09%09age = s.age;%0A%09%7D%0A%09%0A%09void display()%0A%09%7B%0A%09%09System.out.println(%22========%22+schoolname+%22==========%22);%0A%09%09System.out.println(%22Student Details%22);%0A%09%09System.out.println(%22ID: %22+id);%0A%09%09System.out.println(%22Name: %22+name);%0A%09%09System.out.println(%22Age: %22+age);%0A%09%09System.out.println(%22Division: %22+div);%0A%09%09System.out.println(%22=========================%22);%0A%09%7D%0A%7D%0A%0Aclass Student3%7B%0A%09public static void main(String args%5B%5D)%0A%09%7B%0A%09%09Stud dia = new Stud(21, %22Dia%22, %22A%22, 15);%0A%09%09Stud mia = new Stud(dia); //mia will have same values as Dia.%0A%09%09%0A%09%09dia.display();%0A%09%09mia.display();%0A%09%7D%0A%7D%0A

Copy objects using constructors