« Back
package com.string; public class StringToCharArray { public static void main(String[] args) { System.out.println("String is :" +str); String str = "Hello Codersarts"; System.out.println("String Converted into char Array :"); char [] ch = str.toCharArray(); for(int i=0;i< ch.length;i++) { System.out.println(ch[i]); } } }
String is : Hello Codersarts
String Converted into char Array :
H
e
l
l
o
C
o
d
e
r
s
a
r
t
s
×
Report a Problem:
Description:
Submit