How will you execute Three threads sequentially? For eg. Thread1, Thread2, Thread3. It is not possible to pass the reference of one Thread to the other and invoke from the run() method.
So code should be like this:
Thread1.start();
Thread2.start();
Thread3.start();
and out put should be
Printing Thread1
Printing Thread2
Printing Thread3
This can be possible by using ThreadPoolExecutor and using a blocking queue but even that is not an acceptable answer.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…