Arrays工具类详解(中)

public static boolean equals(long[] a,long[] a2);
public static boolean equals(int[] a,int[] a2);
public static boolean equals(short[] a, short[] a2);
public static boolean equals(char[] a, char[] a2);
public static boolean equals(byte[] a, byte[] a2);
public static boolean equals(boolean[] a, boolean[] a2);

public static boolean equals(double[] a, double[] a2);

public static boolean equals(float[] a,float[] a2);

public static boolean equals(Object[] a, Object[] a2);							 

 如果两个指定的 数组彼此相等,则返回 true。如果两个数组包含相同数量的元素,并且两个数组中的所有相应元素对都是相等的,则认为这两个数组是相等的。换句话说,如果两个数组以相同顺序包含相同的元素,则两个数组是相等的。此外,如果两个数组引用都为 null,则认为它们是相等的。

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

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

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

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

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

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

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

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

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

将指定的值分配给指定 类型数组指定范围中的每个元素。填充的范围从索引 fromIndex(包括)一直到索引 toIndex(不包括)。(如果 fromIndex==toIndex,则填充范围为空。)  

参数:a - 要填充的数组fromIndex - 要使用指定值填充的第一个元素的索引(包括)toIndex - 要使用指定值填充的最后一个元素的索引(不包括)val - 要存储在数组所有元素中的值 

猜你喜欢

转载自yaliya.iteye.com/blog/2386371
今日推荐