Convert string to char array : String « Data Type « Java
- Java
- Data Type
- String
Convert string to char array
public class Main {
public static void main(String[] args) {
String literal = "Examples";
char[] temp = literal.toCharArray();
for (int i = 0; i < temp.length; i++) {
System.out.print(temp[i]);
}
}
}
Related examples in the same category