JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java. util.*;
class Cylinder{
private double rad;
private double h;
public void setRad(double radius){
this.rad=radius;
}
public double getRad(){
return rad;
}
public void setH(double hei){
this.h=hei;
}
public double getH(){
return h;
}
}
public class Program
{
static double vol(double rad, double h){
return 2*3.14*rad*h;
}
public static void main(String[] args) {
Cylinder sc=new Cylinder();
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run