(String[] args)
| 1 | class ThreadsDemo { |
| 2 | public static void main(String[] args) throws InterruptedException { |
| 3 | Runnable worker = () -> { |
| 4 | for (int i = 1; i <= 3; i++) { |
| 5 | System.out.println("Typing tick " + i); |
| 6 | try { |
| 7 | Thread.sleep(100); |
| 8 | } catch (InterruptedException e) { |
| 9 | Thread.currentThread().interrupt(); |
| 10 | } |
| 11 | } |
| 12 | }; |
| 13 | |
| 14 | Thread thread = new Thread(worker); |
| 15 | thread.start(); |
| 16 | thread.join(); |
| 17 | |
| 18 | System.out.println("Session complete"); |
| 19 | } |
| 20 | } |
nothing calls this directly
no outgoing calls
no test coverage detected