Java Programming quiz, level Intermediate, question 14
| Question: | If I want to compare the two strings in the variables "one" and "two" to see if the contents of the strings are identical, which do I write? |
| Answer 1: | if (one.equals(two)) ... This was the CORRECT answer |
| Answer 2: | if (one == two) ... |
| Answer 3: | if (one eq two) ... |
| Answer 4: | if ((one-two) == 0) ... |
This was a question from our quiz ... but we have now provided you with
the answer (above) - we prefer to provide you with information rather than to
puzzle you.
|
|