主题:菜鸟的“字符串处理类String ”问题
我在学习字节型数据转化为字符集输出时对字符集很不是了解,于是就把书上的例子抄下来了。可不能运行不了,希望高手们为我介绍“字符集”,和下面的例子怎样改正。在此谢过了。
例子:
public class str1
{
public static void main(String[]args)
{
byte[] a={1,2,3,4,5,6};
String str=new String(a,3,2,UTF-16);
System.out.println(str);
}
}
命令行输出:
str1.java:6: cannot resolve symbol
symbol : variable UTF
location: class str1
String str=new String(a,3,2,UTF-16);
^
Note: str1.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
1 error
例子:
public class str1
{
public static void main(String[]args)
{
byte[] a={1,2,3,4,5,6};
String str=new String(a,3,2,UTF-16);
System.out.println(str);
}
}
命令行输出:
str1.java:6: cannot resolve symbol
symbol : variable UTF
location: class str1
String str=new String(a,3,2,UTF-16);
^
Note: str1.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
1 error