Computer Applications

When the String m is compared to n, the result obtained is greater than zero. Which of the following is true?

  1. m comes before n in the dictionary.
  2. n comes before m in the dictionary.
  3. m and n are equal.
  4. m and n have the same length.

Java String Handling

2 Likes

Answer

n comes before m in the dictionary.

Reason — If comparing string m to n results in a value greater than zero, it means m is lexicographically greater than n. Hence, n comes before m in the dictionary.

Answered By

1 Like


Related Questions