I don't see the point in this; if you don't know how to get a random integer and then get a value from an array with that, you shouldn't even be touching Java.
Why are you creating a topic for this code ? In addition it does not work : Code:java final Player[] online = Bukkit.getOnlinePlayers();final Player player = online[new Random().nextInt(online.length)];
Even then, creating a new Random() object takes some memory. Why not store a global Random object instead?
Cirno Depending on the utilisation. If he wants to call that method only 2 / 3 times in his code, then he do not need to store it as a global var.