class Welcome {
public static void main(String [] args) throws Exception
{

String str="欢迎使用中文";

byte []b=str.getBytes("gb2312");


for(int i_1=0;i_1<b.length;i_1++)
{
System.out.print(b[i_1]);
}

System.out.println();

}
}

解决方案 »

  1.   

    class Welcome {
    public static void main(String [] args) throws Exception
    {

    String str="欢迎使用中文";    System.out.print(str);


    System.out.println();

    }
    }
      

  2.   

    String str="欢迎使用中文";
     
                    char [] b = null;
                    try {
                       // b = str.getBytes("gb2312");
                      b=  str.toCharArray();
                    } catch (Exception ex) {
                    }
     
                  
                     for(int i_1=0;i_1<b.length;i_1++)
                     {
                             System.out.println(b[i_1]);
                     }
     
                     System.out.println();这样就可以1个1个打印了