import java.util.*;
import java.lang.*;
import java.io.*;
// The main method must be in a class named "Main".
class Cylinder{
int radius,height;
void Setradius (int a){
radius=a;
}
void Setheight (int h){
height=h;
}
/*
class {
int x;
} void set x(int x){
this.x = x;
} void get x(){
return x;
} hum x ko hi define kr ske h this lga kr
*/
int Getradius2(){
return radius;
}
int Getheight2(){
return height;
}
float Getvolume(){
float volume = 3.14f*(radius*radius)*height;
return volume;
}
}
class Main {
public static void main(String[] args)
{
Cylinder c1 = new Cylinder();
System.out.println("chapter 9 practise set");
System.out.println("we are back");
c1.Setradius(25);
c1.Setheight(10);
System.out.println(c1.Getheight2());
System.out.println(c1.Getvolume());
}
}
To embed this program on your website, copy the following code and paste it into your website's HTML: