Computer Applications

The indexOf() method returns the position of the …………… .

  1. first occurrence of the specified character
  2. last occurrence of the specified character
  3. null character
  4. '\n' character

Java String Handling

3 Likes

Answer

first occurrence of the specified character

Reason — The indexOf() method returns the index (position) of the first occurrence of the specified character in a string.

Answered By

1 Like


Related Questions