I have say two threads t1 and t2 which I want to start at the same time (simultaneously), each call System.out.println() to print to console, and then to finish at the same time.
Please advise how to achieve this can it be achieve through executor framework. I am trying to do it with the help of executor framework itself..!!
You can either use 2
CountDownLatches or aCyclicBarrierto do that. For example: