請問下面代碼加粗的部分為什么會報錯?
public class test {
public static void main(String[] args) {
System.out.println("請輸入矩形的長和寬");?
Shape rec=new Rectangle();
rec.perimeter();?
rec.area();?
System.out.println("請輸入圓的半徑");?
Shape cir=new Circle();?
cir.perimeter();
cir.area();?
}
}
2017-08-20
Shape是不是不弗雷#24 你是不是多態哪里沒有學好