Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

solve 10 e 10. What would be the output of the program and why?? public class EqualsDemo { public static void main(String[] args) { public

image text in transcribed

solve 10

e 10. What would be the output of the program and why?? public class EqualsDemo { public static void main(String[] args) { public class First { int i; First el = new First(); First e2 = new First(); First e4 = new First(); public boolean equals (Object o) { First e = (First)o; el.i = 10; e2.i = 20; e4.i = 10; if (this.i==e.i) First e3 = 2; return true; Second e6 = new Second(); else return false; Second e7 = new Second(); } e6.i = 30; e7. i = 30; Third e8 = new Third(); } Third e9 = new Third(); e8.i = 12; 19.i = 12; public class Second { int i; System.out.println(e2.equals (83)); } System.out.println(el.equals(84)); System.out.println(e6.equals(27)); public class Third extends First { System.out.println(e8.equals(89)); } } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

Define absenteeism.

Answered: 1 week ago

Question

=+ Who do you think is right? Why?

Answered: 1 week ago