Java String format char type

Description

Java String format char type

public class Main {

  public static void main(String[] args) throws Exception {
    char c = 'G';
    String str = String.format("%c", c);
    System.out.println(str);//  www .  j  a v a2 s  . co m

    System.out.println(str);
  }
}



PreviousNext

Related