Пишет: Программа вывела в консоль (на экран) слишком много данных.
package com.javarush.task.task16.task1626;
public class Solution {
public static int number = 5;
public static void main(String[] args) {
new Thread(new CountUpRunnable(), "Увеличиваем").start();
}
public static class CountUpRunnable implements Runnable{
private int countIndexUp = Solution.number;
public void run() {
try {
while (true) {
System.out.println(toString());
countIndexUp += 1;
if (countIndexUp == 0) return;
Thread.sleep(500);
}
} catch (InterruptedException e) {
}
}
public String toString() {
return Thread.currentThread().getName() + ": " + countIndexUp;
}
}
}