For week 3 we were supposed to do the following:
Receive the first names of your family members (between 3 to 6 members
of
your family) as command line arguments and create an array of String.
Write a static method called generateNewName() as following:
It receives the array of String as a parameter.
It creates a new first name by taking the 2nd character of each String
from the array
Display the names that were enetered and newly generated name
In the generatNewName() section of my program I have this:
public static void generateNewName(String[] theNames) {
System.out.println("generateNewName: Start");
for (int i=0; i<theNames.length; i++){
char [] charArr = "X".toCharArray();
theNames[i].getChars(1, 2, charArr, 0);
System.out.println(charArr);
It's working but not quite the way I wanted it to. I wanted it to print
the new name all on one line rather than each character on a separate
line. How do I fix this?
Thanks,
Tammy L. Estes
DAFS ~ OIT ~ ADAM
Voice 207-624-8287
[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---