JAVA
java
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
/*Input a number between 0 to 10.*/
import java. util.*;
class Game{
int n;
int java;
public void setnoOf(int n){
this.n=n ;
}
public int guess(){
return n;
}
Game(){
Random ac=new Random ();
java =ac.nextInt(10);
}
public int takeUserInput(){
Scanner sc=new Scanner (System.in);
this. n=sc.nextInt();
return n;
}
public void print(){
System.out.println("Java's choice="+java);
System.out.println("Choice of your's="+n);
}
public void isCorrect(int n){
if(n==java){
System.out.println("You did it both of Java and you have same. choice");
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Laufen