Question: java, please explain why the first segment is right and why the second segment is wrong WITH DETAIL and example . Thank you. Assume you

java, please explain why the first segment is right and why the second segment is wrong WITH DETAIL and example . Thank you.

java, please explain why the first segment is right and why the

Assume you have a class Square. Thislan instance variable, side that is protected and of type double. Write the class definition of a subclass of Square called FancySquare that has a method called getDiagonal. The getDiagonal method gets no arguments but returns the value of side multiplied by the square root of two. 16 of 16: Tue Sep 18 2018 21:27:31 GMT+1000 (Australian Eastern Stand SUBMIT 1 //CODE BELO S RIGHT 3 class Fancy5quare extends Square double getDiagonal0 return side Math.sqrt(2.8) 18 12 13 14 15 BELON IS WRONG public class FancySquare extends Square 17 18 19 public static double getbiagonal) return Square.side Math.sart(2.8) 23 24

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!