Assign the value “Kiwi” to all elements in the array.
String[] |
The fill() method populates an array with a designated value.
Note: The value must match the data type of the array.
Tip: You can specify start and end positions; otherwise, all elements will be filled.
Arrays.fill(array,
|
Arrays.fill(array, |
Parameter |
Description |
array |
Necessary: Rephrase the array intended for population. |
start |
Voluntary: Rephrase the starting index position of the first element (inclusive) to be populated. |
end |
Voluntary: Rephrase the ending index position of the last element (exclusive) to be populated. |
value |
Necessary: Rephrase the value intended for populating the array. |
Returns: |
No return value |
Java version: |
1.2 ( |
Populate the final two elements.
String[] |