JAVA. ЗАДАЧА 16.03.03. THREAD.

package com.javarush.test.level16.lesson03.task03; import java.util.ArrayList; import java.util.List; /* Список и нити В методе main добавить в статический объект list 5 нитей SpecialThread - различных объектов. */ public class Solution { public static volatile List<Thread> list = new ArrayList<Thread>(5); public static void main(String[] args) { //Add your code here - добавьте свой код тут SpecialThread thread = [...]

By | Сентябрь 9th, 2016|Categories: Уровень 16|Tags: , |0 Comments

JAVA. ЗАДАЧА 16.03.02. THREAD.

package com.javarush.test.level16.lesson03.task02; /* My second thread 1. Создать public static класс TestThread унаследовавшись от класса Thread. 2. Создать статик блок внутри TestThread, который выводит в консоль "it's static block inside TestThread". 3. Метод run должен выводить в консоль "it's run method". */ public class Solution { public static void main(String[] args) { TestThread thread = [...]

By | Сентябрь 9th, 2016|Categories: Уровень 16|Tags: |0 Comments

JAVA. ЗАДАЧА 16.03.01. THREAD.

package com.javarush.test.level16.lesson03.task01; /* My first thread Создать public static class TestThread - нить с помощью интерфейса Runnable. TestThread должен выводить в консоль "My first thread". */ public class Solution { public static void main(String[] args) { TestThread task = new TestThread(); new Thread(task).start(); } public static class TestThread implements Runnable { @Override public void run() [...]

By | Сентябрь 9th, 2016|Categories: Конспекты, Уровень 16|Tags: , |0 Comments