Skip to main content
1 of 3
sactiw
  • 22.6k
  • 4
  • 44
  • 28

Below are various ways to convert to char c to String s (in decreasing order of speed and efficiency)

char c = 'a'; String s = String.valueOf(c); \\ fastest + memory efficient String s = Character.toString(c); String s = new String(new char[]{c}); String s = String.valueOf(new char[]{c}); String s = "" + c; \\ slowest + memory inefficient 
sactiw
  • 22.6k
  • 4
  • 44
  • 28