O que tem de errado aqui? não compreendo o por que.
Existe algum guia algum modo de compreender melhor os erros do compilador? as vezes fica muito subjetivo o erro.
import java.util.ArrayList;
public class DotCom {
private ArrayList<String> locationCells;
public void setLocationCells(ArrayList<String> loc) {
locationCells = loc;
public String checkYourself(String userInput) {
String result = "miss";
int index = locationCells.indexOf(userInput);
if (index >= 0) {
locationCells.remove(index);
if (locationCells.isEmpty()) {
result = "kill";
} else {
result = "hit";
}
}
}
}
Quando compilo aparece o seguinte erro:
[quote]javac DotCom.java
DotCom.java:9: error: illegal start of expression
public String checkYourself(String userInput) {
^
DotCom.java:9: error: ‘;’ expected
public String checkYourself(String userInput) {
^
DotCom.java:9: error: ‘;’ expected
public String checkYourself(String userInput) {
^
DotCom.java:24: error: reached end of file while parsing
}
^
4 errors
[/quote]