这是我的错误。有谁知道我为什么会收到这个错误的问题?我正在使用 JGrasp
PeerTutorReport.java:13: error: <identifier> expected
public static String[] getTutorNames(listNames) {
^
1 error
----jGRASP楔2:进程退出代码为1。
import javax.swing.JOptionPane;
import java.util.Arrays;
public class Report {
public static void main(String[] args) {
String[] listNames = getTutorNames();
}
public static String[] getTutorNames(listNames) {
String firstName;
String lastName;
String[] listNames = new String[10];
for (int x = 0; x < listNames.length; x++) {
firstName = JOptionPane.showInputDialog(null, "Enter Tutor's First Name: ");
lastName = JOptionPane.showInputDialog(null, "Enter Tutor's Last Name: ");
if (firstName.equals("") && lastName.equals("")) {
break; // loop end
}
listNames[x] = lastName + ", " + firstName;
}
return listNames;
}
}