There
are many ways to convert a character to a string.
Example
public class CharToString { public static void main(String args[]){ char ch = 'a'; String str1 = String.valueOf(ch); String str2 = Character.toString(ch); String str3 = "" + ch; String str4 = new String(new char[]{ch}); } }
No comments:
Post a Comment