为什么这个test1的长度是6?我明明开辟了1024的内存啊
public class AyyayTest {
public static void main(String[] args) {
byte[] test1=new byte[1024];
test1="doload".getBytes();
System.out.println(test1.length);
}
}
为什么这个test1的长度是6?我明明开辟了1024的内存啊
public class AyyayTest {
public static void main(String[] args) {
byte[] test1=new byte[1024];
test1="doload".getBytes();
System.out.println(test1.length);
}
}