Skip to content
Snippets Groups Projects
Commit 84f5f2e8 authored by dragapsy's avatar dragapsy
Browse files

Tache 4 (Constructeur qui fait rien + randomElement(T[] elements, Random random)).

parent 2a30a1c8
No related branches found
No related tags found
No related merge requests found
package util;
import java.util.Random;
public class RandomUtil {
private RandomUtil(){}
public static <T> T randomElement(T[] elements, Random random){
T element= elements[random.nextInt(elements.length)];
return element;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment