DEV/DEV2.1/hasard/exo3/Piece.java
2023-04-27 11:24:21 +02:00

25 lines
377 B
Java

import java.util.Random;
public class Piece implements ObjetAleatoire
{
Random rnd = new Random(System.currentTimeMillis());
private int pof;
public void lancer()
{
this.pof = rnd.nextInt(2);
}
public int lire()
{
return this.pof;
}
public static void main(String[] args) {
Piece test = new Piece();
test.lancer();
System.out.println(test.lire());
}
}