import java.util.Scanner;public class Rectangle extends Shape { @Override public void zhouchang() { // TODO Auto-generated method stub System.out.println("请输入长方形的长度:"); int a=input.nextInt(); System.out.println("请输入长方形的宽度:"); int b=input.nextInt(); int num=a+b; System.out.println("长方形的周长为"+num); }报错Exception in thread "main" java.lang.Error: Unresolved compilation problems: input cannot be resolved为啥啊?是因为不是main方法?
添加回答
举报
0/150
提交
取消