RandomArray

Random generator for array objects.

Description

The RandomArray class can be used as a random generator for array objects.

Static methods

pick

Picks a random element from a specified array.

public static T pick(List values)

  • values: List - array of any type
  • returns: T - randomly picked item.

Examples

{@code
  int value1 = RandomArray.pick(new int []{1, 2, 3, 4}); // Possible result: 3
  }