Multiple choice

Which of the following methods is used to convert a given string to a new character array?

  1. toArray()

  2. StringToArray()

  3. toCharArray()

  4. toCArray()

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

The toCharArray() method is used to convert a given string to a new character array. Its return type is character array. Syntax: char[] toCharArray();