主题:String(byte[],int) 过期问题?
import java.io.*;
class Input
{
public static void main(String args[]) throws IOException
{ byte buf []=new byte[20];
try
{
System.in.read(buf);
}
catch(IOException e)
{
System.out.println(e.toString());
}
String str=new String(buf,0);
System.out.println(str);
}
}
jdk1.6.0_05
编译时警告 String(byte[],int) 已过期,如何更改?
class Input
{
public static void main(String args[]) throws IOException
{ byte buf []=new byte[20];
try
{
System.in.read(buf);
}
catch(IOException e)
{
System.out.println(e.toString());
}
String str=new String(buf,0);
System.out.println(str);
}
}
jdk1.6.0_05
编译时警告 String(byte[],int) 已过期,如何更改?