Question: Find the output of the below Java program? class Student implements Cloneable { int id; Student ( int id ) { this.id = id; }

Find the output of the below Java program?
class Student implements Cloneable { int id; Student(int id){ this.id = id; } public static void main(String[] args) throws CloneNotSupportedException { Student s1= new Student(9); Student s2= s1; s1.id =18; System.out.println(s1.id+""+s2.id); }}
a)99
b)189
c)918
d)1818

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!