Question 2
Consider the following code.
class ContactInfo implements Cloneable{ String email; // Constructor // Accessor method getEmail() // Mutator method setEmail() public ContactInfo clone() throws CloneNotSupportedException{ return (ContactInfo)super.clone(); }}class Student implements Cloneable{ String name; ContactInfo ci; // Constructor // Mutator method setName() public Student clone() throws CloneNotSupportedException{ Student s = (Student)super.clone(); s.ci = s.ci.clone(); return s; } public String toString(){ return name + ":" + ci.getEmail(); }}public class Test { public static void main(String[] args) { Student s1 = new Student("Rahul", new ContactInfo("mail")); try{ Student s2 = s1.clone(); s2.ci.setEmail("new mail"); s2.setName("Sreeja"); System.out.println(s1); System.out.println(s2); } catch(Exception e){ System.out.println(e); } }}What will the output be?