Fill Elements in a long type Array in Java
Description
The following code shows how to fill Elements in a long type Array.
Example
//from w w w . j a va 2 s . c om
import java.util.Arrays;
public class Main {
public static void main(String[] argv) throws Exception {
long[] longArr = new long[10];
long longFillValue = -1;
Arrays.fill(longArr, longFillValue);
System.out.println(Arrays.toString(longArr));
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »