0 votes
in JAVA by
How to convert string to char array in java?

1 Answer

0 votes
by

How to convert string to char array in java?

public class StringToCharArrayExample{  

public static void main(String args[]){  

String s1=""hello"";  

char[] ch=s1.toCharArray();  

for(int i=0;i<ch.length;i++){  

System.out.print(ch[i]);  

}  

}}  

🔗Reference : stackoverflow.com

🔗Source: Java Interview Questions and Answers

🔗Reference: Javatpoint.com

Related questions

0 votes
asked Oct 18, 2020 in JAVA by sharadyadav1986
0 votes
asked Oct 20, 2020 in JAVA by sharadyadav1986
...