java - Im getting the same one error over and over -


this error. know problem why im getting error ? im using jgrasp

peertutorreport.java:13: error: <identifier> expected     public static string[] gettutornames(listnames) {                                                   ^ 1 error 

----jgrasp wedge2: exit code process 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];      (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; } 

}

you have 2 errors:

  1. you have define type listnames argument.

    public static string[] gettutornames(listnames) { //type of listnames?? 
  2. your gettutornames needs pass argument:

    string[] listnames = gettutornames(); //argument here! 

looks need remove listnames argument gettutornames method.

public static string[] gettutornames() {     //code content... } 

Comments

Popular posts from this blog

asp.net mvc 3 - Using mvc3, I need to add a username/password to the sql connection string at runtime -

kineticjs - draw multiple lines and delete individual line -

thumbnails - jQuery image rotate on hover -