私はJavaが初めてで、学習を開始するためにこの素晴らしい本を購入しました。演習の1つで、これを行うように求められました(本の内容とまったく同じです):
class SimpleDotComTestDrive {
public static void main (String[] args) {
SimpleDotComTestDrive hu = new SimpleDotComTestDrive();
int[] locations = {2,3,4};
hu.setLocationCells(locations);
String userGuess = "2";
String result = hu.checkYourself(userGuess);
String testResult = "failed";
if (result.equals("hit") ) {
testResult = "passed";
}
System.out.println(testResult);
}
}
このコードをコンパイルしてこのエラーが発生するまで、数週間は正常にコンパイルされる Notepad++ でこのコードをコンパイルしました。
SimpleDotComTestDrive.java:8: error: cannot find symbol
hu.setLocationCells(locations);
^
symbol: method setLocationCells(int[])
location: variable hu of type SimpleDotCom
SimpleDotComTestDrive.java:12: error: cannot find symbol
String result = hu.checkYourself(userGuess);
^
symbol: method checkYourself(String)
location: variable hu of type SimpleDotCom
2 errors
過去数時間インターネットを検索して修正できなかったので、かなり迷惑です。これの何が問題なのか考えられる場合は、できるだけ早くお知らせください。よろしくお願いします!!!
見る !!! notepad++ が最適な IDE ではないことはわかっていますが、この本では学習目的でシンプルな IDE を使用するように勧められているので、他の IDE を使用するように頼まないでください。