Print Thread in a sequential manner package com.rohan.test; /** * * @author ROHAN There are 5 threads t1, t2, t3, t4, t5 we want to print 1 to 100 in ascending order but all these integers should be printed by above 5 threads in sequential order. Ex: t1 will print : 1 t2 will print : 2 t3 will print : 3 t4 will print : 4 t5 will print : 5 t1 will print : 6 t2 will print : 7 */ class PrintSequentialThread implements Runnable { static Object lock = new Object(); int totalnum = 100; static int num = 1; int sequence; PrintSequentialThread(int sequence) { this.sequence = sequence; } @Override public void run() { while(num <= totalnum-4) { synchronized(lock) { while(num % 5 != sequence) { try { lock.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } System.out.println(Thread.currentThread().getName()+ " will print :...