Question: What is the final output of the code segment below? public class SchoolRunner { public static void main(String[args) { School Sl=new Schoolo: School S2=new School0;
What is the final output of the code segment below? public class SchoolRunner { public static void main(String[args) { School Sl=new Schoolo: School S2=new School0; Check(S1,S2); } public void check(School S1, School S2) { if (SI==S2) System.out.println("Same schools"); else System.out.println("Different Schools"); Si=S2; if (Si=S2) System.out.println("Same schools"): else System.out.println("Different Schools"); } } Output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
