我是在 Eclipse 编辑 使用 java.io 却发生问题 直接复制网络上的教学也是无法执行?
以下是我所编译的
package pratice;
import java.io.*;
public class prac_ch03
{
public static void main(String args[])throws IOException
{
float height;
float weight;
System.out.println("Please input your height.");
height = keyin.readLine();
System.out.println("Please input your weight.");
weight = keyin.readLine();
System.out.println("Your BMI is :" + weight/(height*height));
}
}
执行出现:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
keyin cannot be resolved
keyin cannot be resolved
at pratice.prac_ch03.main(prac_ch03.java:13)
请问是我忽略什么步骤以至于如此吗?
在网络上寻找都找不到解答
麻烦各位!