Arrays And Objects

Create a class called Cylinder.java that contains two double-precision instance variables named radius and height. The class should include a constructor that initializes the radius and height variables. Additionally, there should be two accessor methods that return an object’s radius and height, respectively, and a class method named volume() that returns the volume of a Cylinder object. The volume of a cylinder is given by its radius squared times its height times Pi. You can either use the value 3.1416 for Pi or use the Java provided value named Math.PI. see attachment for futher instruction

Leave a Reply

Your email address will not be published. Required fields are marked *