Question 1
Consider the Java code given below.
class Student{ private String name; public Student(String n){ this.name = n; } public Student(Student s){ this.name = s.name; } public void setName(String n){ name = n; } public String getName(){ return name; }}public class Test{ public static void main(String[] args){ Student s1 = new Student("Ram"); Student s2 = s1; Student s3 = new Student(s1); s1.setName("Rahul"); System.out.println("s2.name : " + s2.getName()); System.out.println("s3.name : " + s3.getName()); }}What will the output be?