Answers for "arrays in constructor java"

0

arrays in constructor java

//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;
Posted by: Guest on December-02-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language