Table of Content

Fill a Short Array in Java


Declaration :

Explanation :

Purpose The java.util.Arrays.fill(short[] a short val) method assigns the specified short value to each element of the specified array of shorts.
Parameters a ===> This is the array to be filled.
val ===> This is the value to be stored in all elements of the array.
Return Value This method does not return value.
Exception NA

Java Program : Example

Below example will explain java.util.Arrays.fill() method.

Output of Program :