Just when I think I have it... Now I am TOTALLY confused!! There has to be a simpler way of explaining this...
HELP! Tammy L. Estes DAFS ~ OIT ~ ADAM Voice 207-624-8287 [EMAIL PROTECTED] -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of miga Sent: Thursday, September 04, 2008 1:57 PM To: Free Java Programming Online Training Course By Sang Shin Subject: [java programming] Re: Homework MyOwnBuiltinClass On Sep 4, 7:07 pm, "Estes, Tammy" <[EMAIL PROTECTED]> wrote: > In the generatNewName() section of my program I have this: > > public static void generateNewName(String[] theNames) { The requirement is to have a static method which generates the new name, not which generates and print the new name. Hence do not use void in the method, but return a String. Then in the main method, you will have a String variable (initialized to nothing at the beginning), which catches the generated name returned by this method. Then you simply print this String variable. For this to work, you should initialize the String to be returned to an empty String at the beginning of this method. > > System.out.println("generateNewName: Start"); > > for (int i=0; i<theNames.length; i++){ here you just construct your new name, with a construct like this: generatedName = generatedName + .... ... is for you to guess what it should be. Hint, see the charAt method. > > char [] charArr = "X".toCharArray(); > > theNames[i].getChars(1, 2, charArr, 0); > > System.out.println(charArr); You have to drop the three lines above. Then you close the loop and return the new name generated. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
