Question
Student s1, s2, s3, s4, s5; s1 = new Student(Cyrus); s5= new Student(Parth); s2= new Student(Olivia); s3 = new Student(Seth); s1.addCredits(5); s2.addCredits(4); s3.addCredits(8); s5.addCredits(3); s4
Student s1, s2, s3, s4, s5;
s1 = new Student("Cyrus);
s5= new Student("Parth);
s2= new Student("Olivia);
s3 = new Student("Seth);
s1.addCredits(5);
s2.addCredits(4);
s3.addCredits(8);
s5.addCredits(3);
s4 = s3
;s5 = s1;
s1 = s3;
s3 = s2;
s1.addCredits(5);
s2.addCredits(3);
s3.addCredits(2);
s4.addCredits(6);
System.out.println( s1.getName() + : "+s1.getCredits() );
System.out.println( s2.getName() + : "+ s2.getCredits() );
System.out.println( s3.getName() + : "+ s3.getCredits() );
System.out.println( s4.getName() + : "+ s4.getCredits() );
System.out.println( s5.getName() + : "+ s5.getCredits() );
*** Predict output in this box***
s1:
s2:
s3:
s4:
s5:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started