Check out example codes for "store string elements in character array in java". It will help you in understanding the concepts better.

Code Example 1

import java.util.*; 
  
public class GFG { 
  
    public static void main(String args[]) 
    { 
  
        String str = "GeeksForGeeks"; 
  
        // Creating array and Storing the array 
        // returned by toCharArray() 
        char[] ch = str.toCharArray(); 
  
        // Printing array 
        for (char c : ch) { 
            System.out.println(c); 
        } 
    } 
}

Code Example 2

// Java program to Convert a String 
// to a Character array using Naive Approach 
  
import java.util.*; 
  
public class GFG { 
  
    public static void main(String args[]) 
    { 
        String str = "GeeksForGeeks"; 
  
        // Creating array of string length 
        char[] ch = new char[str.length()]; 
  
        // Copy character by character into array 
        for (int i = 0; i < str.length(); i++) { 
            ch[i] = str.charAt(i); 
        } 
  
        // Printing content of array 
        for (char c : ch) { 
            System.out.println(c); 
        } 
    } 
}

Learn ReactJs, React Native from akashmittal.com