Array Methods in java | Array Function

java.util

Class Arrays



  • public class Arrays extends Object

    This class contains various methods for manipulating arrays (such as sorting and searching).


    copyOf(int[] original, int newLength)

    Copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length

    equals(int[] a, int[] a2)

    Returns true if the two specified arrays of ints are equal to one another.

    fill(int[] a, int val)

    Assigns the specified int value to each element of the specified array of ints.

    toString(int[] a)

    Returns a string representation of the contents of the specified array.

    sort(int[] a)

    Sorts the specified array into ascending numerical order.

  • .

Post a Comment

0 Comments