-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSolution.java
More file actions
61 lines (42 loc) · 1.69 KB
/
Solution.java
File metadata and controls
61 lines (42 loc) · 1.69 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//Now the God of patience and of encouragement grant you to be of the same mind one with another according to Christ Jesus (Romans 15:5)
package com.javarush.task.task16.task1618;
/*
Снова interrupt
*/
public class Solution {
public static void main(String[] args) throws InterruptedException {
TestThread tt = new TestThread();//Add your code here - добавь код тут
tt.start();
tt.interrupt();
}
//Add your code below - добавь код ниже
public static class TestThread extends Thread {
public void run() {
}
}
}
/*
Снова interrupt
Создай нить TestThread.
В методе main создай экземпляр нити, запусти, а потом прерви ее используя метод interrupt().
Требования:
1. Класс TestThread должен быть унаследован от Thread.
2. Класс TestThread должен иметь public void метод run.
3. Метод main должен создавать объект типа TestThread.
4. Метод main должен вызывать метод start у объекта типа TestThread.
5. Метод main должен вызывать метод interrupt у объекта типа TestThread.
package com.javarush.task.task16.task1618;
*
Снова interrupt
*
public class Solution {
public static void main(String[] args) throws InterruptedException {
//Add your code here - добавь код тут
}
//Add your code below - добавь код ниже
public static class TestThread extends Thread {
public void run() {
}
}
}
*/