Multiple choice

Which of the following functions cannot be invoked using the object of String class?

  1. toLower()

  2. trim()

  3. split()

  4. Both (1) and (3)

  5. Both (2) and (3)

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This is the correct answer. Because there is no method defined in the String class named toLower(). So it cannot be invoked using the object of String class. The correct method is toLowerCase() which converts the characters to lowercase.