String To Character in Java

public class StringToCharacter{
 
  public static void main(String args[]){
    String str= "ForgetCode";
    char[] stringArray;
    stringArray = str.toCharArray();
    for(int index=0; index < stringArray.length; index++)
      System.out.print(stringArray[index]);
   
  }
 
}