0 votes
in JAVA by
How to convert String to char and vice versa?

1 Answer

0 votes
by

This is a tricky question because String is a sequence of characters, so we can’t convert it to a single character. We can use use charAt method to get the character at given index or we can use toCharArray() method to convert String to character array.

Check this post for sample program on converting String to character array to String.

Related questions

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