how to define integer array in java in constructor code example Example: java initialize int array int[] arr = new int[n];