当我尝试使用此方法时,我收到标题中的消息,但我找不到原因。谁能帮助我?
谢谢!
void companyInfo() {
int tel = 0;
System.out.print("Name of company: ");
String tmpCompany = sc.next();
for (int i = 0; i < tel; i++){
if (tmpCompany.equals(null)){
}
}
for (int i = 0; i < 10; i++) {
int count = 0;
for (int j = 0; j < field.length; j++){
for (int k = 0; k < field[k].length; k++){
if (tmpCompany != (null) && field[i][j] != 0 && tmpCompany.equals(felt[i][j])){
count++;
}
}
}
if (tmpCompany != null && count > 0) {
System.out.print("The company " + tmpCompany + " owns " + count + " field(s).");
}
}
}