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方法?
相关分类