Assume you have a class Square. This class has an 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.

Java

LANGUAGE: JAVA CHALLENGE: Assume you have a class Square. This class has an 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…

Read More