Program:
public class StringToCharArr {
public static void main(String[] args) {
String strOrg ="Hello World!!";
char[] stringArray;
// covert string into array using toCharArray() method of string class.
stringArray = strOrg.toCharArray();
for(int index =0; index <stringArray.length; index++){
System.out.print(stringArray[index]);
}
}
}
Answer:
Hello World!!
0 Comments