Java计算圆的容积和体积
package project
import java.net.SocketTimeoutException;
public class test {
static String test1="hello";
public static void main(String[] args){
String test2="world";
System.out.println("hello world!");
int r =5,h = 3 ;
double area=Math.PI*r*r;
double volume=area*3;
double rom=volume*750;
System.out.println("体积大小是:"+volume);
System.out.println("容积大小是:"+rom);
}
}