package ru.job4j.concurrent;

/**
 * Class ThreadState
 *
 * @author Kseniya Dergunova
 * @since 05.04.2020
 */
public class ThreadState {
    public static void main(String[] args) {
        Thread first = new Thread(
                () -> {}
        );
        Thread second = new Thread(
                () -> {}
        );
        System.out.println(String.format("Нить 1: %s, %s", first.getState().toString(), first.getName()));
        System.out.println(String.format("Нить 2: %s, %s", second.getState().toString(), second.getName()));
        first.start();
        second.start();
        while (first.getState() != Thread.State.TERMINATED && second.getState() != Thread.State.TERMINATED) {
            System.out.println(first.getState());
            System.out.println(second.getState());
        }
        System.out.println(String.format("First is %s, %s", first.getState().toString(), first.getName()));
        System.out.println(String.format("Second is %s, %s", second.getState().toString(), second.getName()));
        System.out.println(String.format("Work completed %s", Thread.currentThread().getName()));
    }
}

@@ -227,32 +227,49 @@
          () -%3E %7B
+%0A                
 %7D%0A        );%0A   
@@ -324,16 +324,33 @@
  () -%3E %7B
+%0A                
 %7D%0A      
@@ -641,33 +641,33 @@
 irst.getState() 
-!
+=
 = Thread.State.T
@@ -669,21 +669,19 @@
 ate.
-TERMINATED &&
+RUNNABLE %7C%7C
  sec
@@ -699,9 +699,9 @@
 e() 
-!
+=
 = Th
@@ -715,18 +715,16 @@
 ate.
-TERMINATED
+RUNNABLE
 ) %7B%0A

1.1. Состояние нити.[#268036] fix mistake