Question 5
Consider the code given below.
class Date{ int date, month, year; //Constructor to initialize instance variables public String toString() { return "DOB = " + date + "-" + month + "-" + year; }}class Student{ private String name; private Date dob; public Student(String name) { this.name = name; } public Student(Student s) { this.name = s.name; } public void setDob(Date dob) { this.dob = dob; } public String toString() { return "name = " + name+", "+dob; }}public class ConTest { public static void main(String[] args) { Student obj1 = new Student("ABC"); obj1.setDob(new Date(1, 6, 1990)); Student obj2 = new Student(obj1); obj2.setDob(new Date(31, 1, 1992)); System.out.println(obj1); System.out.println(obj2); }}What will the output be?