Page 1 of 1

Assume you have the following definition of class A: public class A{ private int x; private String s; public A(int a, St

Posted: Fri Jul 08, 2022 6:43 am
by answerhappygod
Assume You Have The Following Definition Of Class A Public Class A Private Int X Private String S Public A Int A St 1
Assume You Have The Following Definition Of Class A Public Class A Private Int X Private String S Public A Int A St 1 (108.25 KiB) Viewed 34 times
Assume you have the following definition of class A: public class A{ private int x; private String s; public A(int a, String b) { x = a; s = b; } } And the following fragment of code: String s1 = "Hello"; A a1 = new A(10, s1); A a2 = new A(10, s1); A a3 = new A(20, s1); Which of the comparisons using equals is true? a1.equals(a3) None of the above. a1.equals(a2) a2.equals(a3)