How do you convert a character type into a string type??
barbz 0 Newbie Poster
Recommended Answers
Jump to Postchar c = 'a';
String s = new String("" + c);It is easier to do this:
String s = c + "";
But this is better:String s = String.valueOf(c);
I have checked and the latter is faster
All 3 Replies
quuba 81 Posting Pro
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
barbz 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.