📜  构造函数java代码示例中的数组

📅  最后修改于: 2022-03-11 14:52:36.958000             🧑  作者: Mango

代码示例1
//To allocate an integer array which all elements are initialized to zero, write this in the constructor:

data = new int[3];
//To allocate an integer array which has other initial values, put this code in the constructor:

int[] temp = {2, 3, 7};
data = temp;