Question: nalyze the following code. Program 1 : public class Test { public static void main ( String [ ] args ) { Object a 1
nalyze the following code.
Program :
public class Test
public static void mainString args
Object a new A;
Object a new A;
System.out.printlnaequalsa;
class A
int x;
public boolean equalsObject a
return this.x Aax;
Program :
public class Test
public static void mainString args
Object a new A;
Object a new A;
System.out.printlnaequalsa;
class A
int x;
public boolean equalsA a
return this.x ax;
Program displays false and Program displays false
Program displays true and Program displays false
Program displays false and Program displays true
Program displays true and Program displays true
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
