Search:

Type: Posts; User: Norm

Search: Search took 0.09 seconds.

  1. Replies
    13
    Views
    1,197

    Re: Vector of array [logic error]

    I find using println() statements to print out the values of variables and expressions used in if statements useful.
    I assume that the computer is right and the I must have made a mistake when the...
  2. Replies
    13
    Views
    1,197

    Re: Vector of array [logic error]

    Where do you see "string" in v?
    v.element(1) is close: "string|" but it is different.
    contains() would not find it as a match!
  3. Replies
    13
    Views
    1,197

    Re: Vector of array [logic error]

    Print out the two values next to the if statement that uses the contains() method so you can see what the method sees when it executes.
    Print the values of v and vFrases.elementAt(i)[j]
  4. Replies
    13
    Views
    1,197

    Re: Vector of array [logic error]

    Did you add a println that printed out the values that I suggested? What was printed?
    Add the println code for the values I suggested, run the program and copy the print out and paste it here.
  5. Replies
    13
    Views
    1,197

    Re: Vector of array [logic error]

    Do some debugging by adding a println statement to print out the contents of v and the elementAt()'s value so you can see what is in v and what the contains() method is looking for.
  6. Replies
    13
    Views
    1,197

    Re: Vector of array [logic error]

    I added this line first thing in the main() method to get the input you described:

    args = new String[] {"first string", "second string", "third string"}; //<<<<<<<<<<

    and get this error:...
Results 1 to 6 of 6