public class test { public static void main(String args[]) { float r; float ares; System.out.println(please input the radius:); r=System.in.read(); ares=3.14*r*r; System.out.println(the ares is:+ares); } }
public static void main(String[] args) throws IOException {
Scanner cin = new Scanner(System.in); System.out.print(Please input the radius : ); double r = cin.nextDouble(); VolumeAndArea x = new VolumeAndArea();
System.out.println(The volume is : + x.volume(r)); System.out.println(The area is : + x.area(r)); }