0

Fill in the blanks to check whether the two objects of type A are semantically equal.

class A { private int x; public ____ equals(Object o) { ___ ((A)o).x == this.x; } public static void main(String[ ] args) { A a = new A(); a.x = 9; A b = new _____ (); b.x = 5; System.out.println(a. ____(b)); } } ===================================================================== new , x , b , boolean , A , return , equals =====================================================================

13th Nov 2016, 6:29 AM
anjanel macalaguim
7 odpowiedzi
+ 7
boolean return A equals
15th Nov 2016, 11:08 AM
D Naveen Kumar
D Naveen Kumar - avatar
+ 1
boolean return A equals
18th Apr 2018, 4:46 AM
Muhammad Zabri Sulaiman
Muhammad Zabri Sulaiman - avatar
+ 1
Drag and drop from the options below to check whether the two objects of type A are semantically equal. class A { private int x; public equals(Object o) { ((A)o).x == this.x; } public static void main(String[ ] args) { A a = new A(); a.x = 9; A b = new (); b.x = 5; System.out.println(a.(b)); } }
28th May 2020, 8:02 PM
javlonbek shoyimqulov
javlonbek shoyimqulov - avatar
0
class A { private int x; public boolean equals(Object o) { return ((A)o).x == this.x; } public static void main(String[ ] args) { A a = new A(); a.x = 9; A b = new A(); b.x = 5; System.out.println(a.equals(b)); } }
28th Nov 2019, 5:26 PM
Patrick CYUBAHIRO
Patrick CYUBAHIRO - avatar
0
boolen return A equal
17th Aug 2020, 2:07 PM
kedir.y
kedir.y - avatar
0
boolean return A equals
1st Jan 2022, 8:13 AM
M.I.M.Aqueel
M.I.M.Aqueel - avatar
0
boolean return A equals
3rd Jul 2022, 2:35 PM
Antenhe Yimer