I need help putting this java code into something I can copy/paste .
Here is the code:
Extracted text: Shape.java: public class Shape { private double area; public Shape({ area = 0.0; } public Shape(double a){ this.area = a; } public void setArea(double a){ area = a; } public double getArea({ return area; } public String toString({ return "Shape:\n\tarea: "+ area; } } ShapeDriver.java: public class ShapeDriver { public static void main(String[] args) { Circle cir = new Circle(); cir.setRadius(5.0); System.out.println(cir.toString() + "In\tradius: "+ cir.getRadius(); Cirlce.java: public class Circle extends Shape{ private double radius; private final double PI = 3.17; public void setRadius(double r){ this.radius = r; double area = PI*Math.pow(r,2); setArea(area); } public double getRadius() { return this.radius; }
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here