的默认值是什么Value[],为什么,因为,我需要默认值来编写测试用例。
property.getValues将返回Value[],但只是想看看究竟是什么默认值 Value[]
谢谢
的默认值是什么Value[],为什么,因为,我需要默认值来编写测试用例。
property.getValues将返回Value[],但只是想看看究竟是什么默认值 Value[]
谢谢
Anything that holds an object is initialized to null.
int/short/byte 0.
float/double 0.0
booleans false.
当您使用新的和数组大小创建数组时,所有条目都归零。在这种情况下,答案为空。您需要显式初始化任何局部变量。
与任何 Java 数组一样,数组类型的对象字段Value[]默认为null,而不管 的确切类型如何Value:
public class Demo {
private int[] intArray;
private String[] strArray;
private MyClass[] myArray;
}
在上面的示例中intArray,strArray、 和myArray将一直存在,null直到您为它们分配值。