作者:
ProGramE (SP_one)
2017-07-26 02:10:34我是在 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)
請問是我忽略甚麼步驟以至於如此嗎?
在網路上尋找都找不到解答
麻煩各位!