X
xiaobong
Unregistered / Unconfirmed
GUEST, unregistred user!
我的程序:当输入中文时是一些问号,怎么回事?
public static void main(String[] args)
{
byte buffer2[] = new byte[255];
String inputStr2="";
try
{
System.out.print ("请再输入一个字符串:") ;
System.in.read(buffer2,0,255);
inputStr2 = new String(buffer2,"Default");
System.out.println(buffer2);
inputStr2 =inputStr2.trim();
System.out.println ("你输入的字符串:"+inputStr2) ;
}
catch(Exception e){e.printStackTrace(); }
public static void main(String[] args)
{
byte buffer2[] = new byte[255];
String inputStr2="";
try
{
System.out.print ("请再输入一个字符串:") ;
System.in.read(buffer2,0,255);
inputStr2 = new String(buffer2,"Default");
System.out.println(buffer2);
inputStr2 =inputStr2.trim();
System.out.println ("你输入的字符串:"+inputStr2) ;
}
catch(Exception e){e.printStackTrace(); }