错误:参数列表的长度不同

时间:2014-02-22 15:08:44

标签: java arrays

private class ButtonSelect implements ActionListener {
    @Override
    public void actionPerformed(ActionEvent e) {
        Object Ps = e.getSource();
        String selectedLanguage = (String) languageList.getSelectedItem();
        JOptionPane.showMessageDialog(StudentRecordsGUI.this,
                "You selected the language: " + selectedLanguage);
        if (selectedLanguage != "English") {
        JOptionPane.showMessageDialog(StudentRecordsGUI.this,
            "I'm sorry. The language you have selected is currently not available. Please try again.");
        }
        else
            setVisible(false);
            new Record (student, this, "Student Records");
    }
} //end class ButtonSelect

错误:

java:52: error: constructor Record in class StudentRecordsGUI.Record cannot be applied to given types;
                new Record (student, this, "Student Records");
                ^
  required: Student
  found: ArrayList<Student>,StudentRecordsGUI.ButtonSelect,String
  reason: actual and formal argument lists differ in length

我需要使用:

ArrayList<Student> student = new ArrayList<Student>();

Student课程获取信息,但不会接受。{p>我该如何编辑这一行呢?

0 个答案:

没有答案