summaryrefslogtreecommitdiffstats
path: root/Java/coin.java
blob: 4765812daf691325fb0f02a93bdfbb88da0f654e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.util.Random;

public class coin{

	private boolean status;

public coin(){
	Random random = new Random();
if (random.nextInt() % 2 == 1){ 
	status = true;
} else {
        status = false;
}

}

public String toString(){
     if(status){
return "coin is heads";
     } else {
return "coin is tails";
     }
}

}