Arrays.compare() | Java

 

Descripción

Sintaxis

public static int compare(boolean[] a, boolean[] b)
public static int compare(boolean[] a, int aFromIndex, int aToIndex, boolean[] b, int bFromIndex, int bToIndex)
public static int compare(byte[] a, byte[] b)
public static int compare(byte[] a, int aFromIndex, int aToIndex, byte[] b, int bFromIndex, int bToIndex)
public static int compare(char[] a, char[] b)
public static int compare(char[] a, int aFromIndex, int aToIndex, char[] b, int bFromIndex, int bToIndex)
public static int compare(double[] a, double[] b)
public static int compare(double[] a, int aFromIndex, int aToIndex, double[] b, int bFromIndex, int bToIndex)
public static int compare(float[] a, float[] b)
public static int compare(float[] a, int aFromIndex, int aToIndex, float[] b, int bFromIndex, int bToIndex)
public static int compare(int[] a, int[] b)
public static int compare(int[] a, int aFromIndex, int aToIndex, int[] b, int bFromIndex, int bToIndex)
public static int compare(long[] a, int aFromIndex, int aToIndex, long[] b, int bFromIndex, int bToIndex)
public static int compare(long[] a, long[] b)
public static int compare(short[] a, int aFromIndex, int aToIndex, short[] b, int bFromIndex, int bToIndex)
public static int compare(short[] a, short[] b)
static <T extends Comparable<? super T>>int compare(T[] a, int aFromIndex, int aToIndex, T[] b, int bFromIndex, int bToIndex)
static <T> int compare(T[] a, int aFromIndex, int aToIndex, T[] b, int bFromIndex, int bToIndex, Comparator<? super T> cmp)
static <T extends Comparable<? super T>>int compare(T[] a, T[] b)
static <T> int compare(T[] a, T[] b, Comparator<? super T> cmp)

Parámetros

  • char[] a,
  • boolean[] a,
  • double[] b,
  • int[] b,
  • short[] b,
  • short[] a,
  • byte[] a,
  • float[] a,
  • float[] b,
  • T[] b,
  • int aToIndex,
  • T[] a,
  • long[] a,
  • int bFromIndex,
  • Comparator<? super T> cmp,
  • boolean[] b,
  • int bToIndex,
  • int[] a,
  • double[] a,
  • int aFromIndex,
  • byte[] b,
  • long[] b,
  • char[] b,

Excepciones

IllegalArgumentException, ArrayIndexOutOfBoundsException, NullPointerException

Clase Padre

Arrays

Ejemplo


Líneas de Código

    Manual Java

    Aprende más sobre Java consultando online o descargando nuestro manual.

    Test Java

    ¿Te atreves a probar tus habilidades y conocimiento en Java con nuestro test?

    Vídeos Java

    Disfruta también de nuestros artículos sobre Java en formato vídeo. Aprovecha y suscribete a nuestro canal.