Hi all!
I have a problem with the following coding:
import javax.swing.JOptionPane;
public class MyOwnJavaArray{
public static void main(String[] args) {
String [] fullname = new String [3];
String [] firstname = new String [3];
for(int i = 0; i < fullname.length; i++){
fullname[i] = JOptionPane.showInputDialog("Please enter a
name!");
firstname[i] = fullname[i].split(" "); // this line is marked
in the IDE !!!
}
}
}
The error I get is:
found : java.lang.String[]
required: java.lang.String
firstname[i] = fullname[i].split(" ");
Which side causes the problem, left or right ? Why is a String (and
not a String[]) required, even though there is a String[] on both
sides ?
Any help would be appreciated :)
Kind regards
Frank
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---