Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Replies
    18
    Views
    1,674

    Re: Iterating a String

    I'm afraid there is a lot of magic going on here.
  2. Replies
    18
    Views
    1,674

    Re: Iterating a String

    for (int count = 0; count < String1.length(); count++)
    String1.charAt(count);
    vs

    for(int count = 0; count < aString.length(); count++)
    DisplayLetter(aString.charAt(count));

    Why did...
  3. Replies
    18
    Views
    1,674

    Re: Iterating a String

    Execute this code and see what is printed out:


    String aString = "bubble";
    for(int count = 0; count < aString.length(); count++) {
    System.out.println(count + " " +...
  4. Replies
    18
    Views
    1,674

    Re: Iterating a String

    For the next lines of code I need to see: The DisplayLetter method.
  5. Replies
    18
    Views
    1,674

    Re: Iterating a String

    This is painful. Do I have to ask you for the source line by line?
    You don't show what the value of aString is or the complete output from your program.
  6. Replies
    18
    Views
    1,674

    Re: Iterating a String

    What did you try? I don't see any code.
  7. Replies
    18
    Views
    1,674

    Re: Iterating a String

    Replace the ? with count
  8. Replies
    18
    Views
    1,674

    Re: Iterating a String

    That's an interesting construction of a statement.
    Your previous post was almost there, you just had to put the loop index into the method call.
    Now what have you done?
    What does the API doc for...
  9. Replies
    18
    Views
    1,674

    Re: Iterating a String

    In the code for a loop that you posted, what variable is going to start at 0 and increment by one every time thru the loop?

    Does the code you posted compile? length is a method not a variable in...
Results 1 to 9 of 9