public static void fill(Object[] a, int fromIndex, int toIndex, Object val)

java.lang.Object

  extended by java.util.Arrays

public class Arrays
    
    
     
     extends 
     
     Object
    
    

This class contains various methods for manipulating arrays (such as sorting and searching). This class also contains a static factory that allows arrays to be viewed as lists.

The methods in this class all throw a NullPointerException if the specified array reference is null, except where noted.

The documentation for the methods contained in this class includes briefs description of the implementations. Such descriptions should be regarded as implementation notes, rather than parts of the specification. Implementors should feel free to substitute other algorithms, so long as the specification itself is adhered to. (For example, the algorithm used by sort(Object[]) does not have to be a mergesort, but it does have to be stable.)

This class is a member of the Java Collections Framework

static voidfill(Object[] a, int fromIndex, int toIndex, Object val)           Assigns the specified Object reference to each element of the specified range of the specified array of Objects.
public static void fill(Object[] a,
                        int fromIndex,
                        int toIndex,
                        Object val)
Assigns the specified Object reference to each element of the specified range of the specified array of Objects. The range to be filled extends from index fromIndex, inclusive, to index toIndex, exclusive. (If fromIndex==toIndex, the range to be filled is empty.)

Parameters:
a - the array to be filled
fromIndex - the index of the first element (inclusive) to be filled with the specified value
toIndex - the index of the last element (exclusive) to be filled with the specified value
val - the value to be stored in all elements of the array
Throws:
IllegalArgumentException - if fromIndex > toIndex
ArrayIndexOutOfBoundsException - if fromIndex < 0 or toIndex > a.length
ArrayStoreException - if the specified value is not of a runtime type that can be stored in the specified array
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值