-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstr3
More file actions
47 lines (29 loc) · 819 Bytes
/
Copy pathconstr3
File metadata and controls
47 lines (29 loc) · 819 Bytes
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import java.util.Random;
//class random1 {
// Random rand = new Random();
// public int n = rand.nextInt(10);
// }
//----------------------------------------------------------------
class con1 {
int a;
int b;
// int c;
// Ниже конструктор
con1 (int A, int B ) {
Random rand = new Random();
int n = rand.nextInt(10);
int m = rand.nextInt(10);
a=A*n;
b=B*m;
}
}
public class randomize {
public static void main(String args[]) {
con1 t1 = new con1(10, 4);
// Random rand = new Random();
// int n = rand.nextInt(10);
//constr t2 = new constr();
System.out.println(t1.a);
System.out.println(t1.b);
}
}