求助:键盘输入的问题
import java.lang.Math;public abstract class Area {
public abstract double area();
}
public class RectArea extends Area{
double x,y;
public double area() {
double s1;
s1=x*y;
System.out.println("s1="+s1);
return s1;
}
}
public class RoundArea extends Area{
double z;
public double area(){
double s2;
s2=Math.PI*z*z;
System.out.println("s2="+s2);
return s2;
}
}
public class ImpleArea{
public static void main(String args[]){
RectArea f1=new RectArea();
RoundArea f2=new RoundArea();
try{
System.in.read(double x,double y,double z);
}
catch(Exception e){
System.out.println("error:"+e.toString());
}
f1.area();
f2.area();
}
}
我是新手,不知道 这程序应该怎么改?
望大家帮助一下
谢谢