miguelvmonroy
New Member
I wrote a class and now I am trying to test it, and I get and error on my class test that says "CylinderTest.java:9: getHeight() in Cylinder cannot be applied to (double)"Here is the code for my class:\[code\]public class Cylinderprivate double Radius;private double Height;public final static double Pi = 3.14159;// constructorpublic Cylinder(){ Radius = 0.0;{ Height = 0.0;}// getRaduis methodpublic double getRadius(){ return Radius;}// getHeight methodpublic double getHeight(){ return Height;}// setRadius method public void setRadius(double r){ Radius = r;}// setHeight methodpublic void setHeight(double h){ Height = h;}// getSurfaceAreapublic double getBaseArea(double BaseArea){ BaseArea = Radius * Radius * Pi; return BaseArea;}// getVolumepublic double getVolume(double BaseArea, double Volume){ Volume = BaseArea * Height; return Volume;}// Print//System.out.println("The volume of the cylinder is " +Volume);\[/code\]}and here is the code for the classTest:\[code\]public class CylinderTest { public static void main(String[] args) { Cylinder cylinderA = new Cylinder(); cylinderA.getRadius(3.5); cylinderA.getHeight(4.5); System.out.println(cylinderA.getVolume()); }}\[/code\]The original cylinder class that I wrote compiles fine I am having trouble when I try to compile the classTest. Any help would be greatly appreciated.