How to write a programme that can store names and id using JOptionpane
i tried storing String
but the result comes up with String
cannot be converted to String[]
??
import javax.swing.JOptionPane;
public class TestWorker {
public static void main(String args[]) {
int amount = Integer.parseInt(JOptionPane.showInputDialog(null, "How many Would you like to enter?"));
String[] storedname = new String[amount];
storedname = JOptionPane.showInputDialog(null,"Whats the First persons name?");
Workers(storedname);
}
public static void Workers(String[] Workername){
System.out.println("The name of the First Worker is " + Workername);
}
}