char c = 21457;
System.out.println("s: " + c);打印结果:s: 发String s = "21457";怎样将这个 s 打印的结果也是 发 呢

解决方案 »

  1.   


    //将String类型转换一下就可以了。如下所示:
    class Test
    {
    public static void main(String[] args)
    {
    char c = 21457;
    System.out.println("s: " + c); String str="21457";
    char ch=(char)(Integer.parseInt(str));
    System.out.println(ch); 
    }
    }
      

  2.   

    String cs="21457";
    char css = (char)Integer.parseInt(cs);
    System.out.println(css);