Name

reverse()

Description

Reverses the order of an array.

Examples

  • String sa[] = { "OH", "NY", "MA", "CA"};
    sa = reverse(sa);
    println(sa);
    // Prints updated array contents to the console:
    // [0] "CA"
    // [1] "MA"
    // [2] "NY"
    // [3] "OH"
    

Syntax

  • reverse(list)

Parameters

  • list(boolean[], byte[], char[], int[], float[], String[], Object)booleans[], bytes[], chars[], ints[], floats[], or Strings[]

Return

  • boolean[], byte[], char[], int[], float[], String[], or Object

Related