Question: Can you help me solve the questions? With java public abstract class Shape { public abstract double area; public abstract double perimeter): } a. You
Can you help me solve the questions? With java

public abstract class Shape { public abstract double area; public abstract double perimeter): } a. You wish to use this abstract class and use it to generate a class Square. This class should contain an integer instance variable side. This variable must be initialized by a constructor to the integer value 6. Then the area must be calculated as side and the perimeter must be calculated as 4*side. Finally the area and the perimeter must be printed. b. Write a class TestSquare that makes the needed initializations and prints the following output Square side: 6 Resulting area: 36 Resulting perimeter: 24 C. Given the following program segment: public class Mystery { public static void main(String [] args) { int x = 5 double y = x int zu System.out.println(" x = "+x+"y="+y+" z= "+z); }l/ end main }// end class Is there an error? If so, correct it and give the output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
