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:
you have define type
listnames
argument.public static string[] gettutornames(listnames) { //type of listnames??
your
gettutornames
needs pass argument:string[] listnames = gettutornames(); //argument here!
looks need remove listnames
argument gettutornames
method.
public static string[] gettutornames() { //code content... }
Comments
Post a Comment