I'm really struggling with arrays. The concept I understand, but pulling it
all together has been a challenge.
I have this so far for enter three names and comparing the lengths of the
first names to determine which is the longest.
public static void main(String[] args) {
//declare and create a String array to hold three names
String[] names = new String[3];
int counter;
for (counter=0;counter<names.
length;counter++){
JOptionPane.showInputDialog("Please enter your name");
How do I make sure the names entered are assigned to elements within the
array? My problem is determining the correct way to compare the names once
they are entered. Once the names are entered they aren't stored as
anything, or are they?
Thanks in advance to all!
Jason
--
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