somebody help me please explain this in homework 1036 Java array ,
please?
//Get the first name from a name string using split() instance (non-
static) method
String[] nameArrayForPerson1 = person1NameInstance.split(" ");
String[] nameArrayForPerson2 = person2NameInstance.split(" ");
// Get the lengths of strings using length() instance (non-static)
method
int lengthOfFirstNameOfPerson1 = nameArrayForPerson1[0].length();
int lengthOfFirstNameOfPerson2 = nameArrayForPerson2[0].length();
// Compare the lengths of the first names between person1 and person2
if (lengthOfFirstNameOfPerson1 > lengthOfFirstNameOfPerson2){
System.out.println(nameArrayForPerson1[0] + " has longer first name
than " + nameArrayForPerson2[0]);
}
What does it means .split() ?
is it convert string to integer and comparing divide by 3 times name
and find the longest last name?
Somebody please help? I don't understand this homework. give me some
explanation about this?
ASAP
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---