Check out the Arrays.fill methods.
int[] array = new int[4];
Arrays.fill(array, 1); // [1, 1, 1, 1]
More Related Contents:
- Algorithm for taking elements from an in[] array and concatenating them [closed]
- java.lang.arrayoutofboundexception length:10 index:10
- How do i format a ArrayList for printing?
- Does an Array’s specified capacity include 0?
- java programming homework 2015 [closed]
- How to put one dimensional array in 2d array java
- Make copy of an array
- How to convert int[] into List in Java?
- Java Array, Finding Duplicates
- How can I convert int[] to Integer[] in Java?
- How to find the index of an element in an array in Java?
- Send an Array with an HTTP Get
- Java: Detect duplicates in ArrayList?
- Get only part of an Array in Java? [duplicate]
- How to display a svg byte array as an image in a JasperReport?
- Java: what’s the big-O time of declaring an array of size n?
- Obtaining the array Class of a component type
- PDF to byte array and vice versa
- Java: BufferedImage to byte array and back
- Java Array of unique randomly generated integers
- Java Arrays.asList on primitive array type produces unexpected List type [duplicate]
- Creating nested JSON object for the following structure in Java using JSONObject? [closed]
- How to see if an object is an array without using reflection?
- If a char array is an Object in Java, why does printing it not display its hash code?
- Combine two integer arrays [duplicate]
- casting Arrays.asList causing exception: java.util.Arrays$ArrayList cannot be cast to java.util.ArrayList
- Generate Random Numbers in Array [duplicate]
- How can I convert a Java HashSet to a primitive int array?
- How to remove last comma and space in array? Java [duplicate]
- Sorting two arrays simultaneously