Convert character to String

ReturnMethodSummary
static StringtoString(char c)Returns a String object representing the specified char.
StringtoString()Returns a String object representing this Character's value.

public class Main {
  public static void main(String[] argv) {
    Character character1 = new Character('a');
    Character character2 = new Character('b');
    System.out.println(character1.toString());

    System.out.println(Character.toString(character2));
  }
}

The output:


a
b
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.