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...
Type: Posts; User: Norm
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...
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!
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]
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.
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.
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:...