因为你在1.4版本中使用了java1.1中的函数,这函数是不被推荐使用的,虽然编译没什么错误
你试试
public class Test
{
public static void main(String [] args)
{System.out.println("hello!");
System.out.println("我爱你JAVA!");
byte []b={65,66,67};
String s=new String(b,0,3);
System.out.println(s); //输出为ABC
s=new String(b,1,2);//输出为AB 但编译输出为 ??? 为什么
System.out.println(s);
}
}
是不是正确了?
你试试
public class Test
{
public static void main(String [] args)
{System.out.println("hello!");
System.out.println("我爱你JAVA!");
byte []b={65,66,67};
String s=new String(b,0,3);
System.out.println(s); //输出为ABC
s=new String(b,1,2);//输出为AB 但编译输出为 ??? 为什么
System.out.println(s);
}
}
是不是正确了?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货