Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is for java, could you run it to make sure it works thanks in advance this is the starting code(code would not run in
This is for java, could you run it to make sure it works thanks in advance
this is the starting code(code would not run in netbeans):
Exercise 11-3 Code an equals method In this exercise, you'll add and equals method to the Product and Lineltem classes that you can use to compare the instance variables of two objects. 1. Open the project named chll ex5 Pr 2. Run the project. Since the equals method isn't overridden in the Product or Lineltem oductLister that's in the extra_ex starts directory class, the output from this application should indicate that the comparisons are based on object references and not the data the objects contain like this: The Product class is comparing references The LineItem class is comparing references 3. Open the Product class, and add an equals method as shown in this chapter. Then, run the project again. This time, the output should indicate that the products are being compared based on their data like this: The Product clasa is comparing data The LineItem class is comparing references. 4. Repeat step 3 for the Lineltem class. This time, the comparisons for both the products and line items should be based on their data like this: The Product class is comparing data. The ineItem olass is comparing data
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started