Hints required: sequential vs parallel
package com.codegym.task.task16.task1629;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Solution {
public static volatile BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
static String word1, word2,word3;
public static void main(String[] args) throws InterruptedException {
Read3Strings t1 = new Read3Strings();
Read3Strings t2 = new Read3Strings();
//write your code here
t1.start();
t2.join();
// t1.join();
t2.start();
t1.join();
// t1.start();
// t2.join();
t1.printResult();
t2.printResult();
}
//write your code here
public static class Read3Strings extends Thread
{
public void run()
{
// String word1, word2,word3;
try{
word1=reader.readLine();
word2=reader.readLine();
word3=reader.readLine();
} catch(IOException e)
{
}
}
public void printResult()
{
System.out.print(word1+" ");
System.out.print(word2+" ");
System.out.println(word3+" ");
}
}
}