title: Finding the volume of a cylinder using a circle object
body: <p>I'm supposed to find the volume of a cylinder using a Circle object I made in another class. When I create my getVolume method, it tells me I can't multiply a Circle and double, and wanted to know how to fix it. I can't make a getArea method in the Cylinder class, just make a new Circle using a user-inputted radius. Here's the code (first for the Circle class, and second the Cylinder class):</p>
  
  <pre><code>public class Circle {
    private double radius;
  
    public Circle(double r) {
    radius = r;
    }
  
    public double getArea() {
        return Math.PI * radius * radius;
    }
  }
  
  public class Cylinder {
    private Circle base;
    private double height;
  
    public Cylinder(double r, double h) {
      base = new Circle(r);
      height = h;
    }
  
    public double getVolume() {
      return base * height;
    }
  }
  </code></pre>
  
  <p>So the getVolume method is my problem. How can I get the program to recognize "base" as a double while it is still a Circle object?</p>