public class OrderThread {
public static void main(String[] args) {
// TODO Auto-generated method stub
Runnable r1 = () -> System.out.println("a");
Runnable r2 = () -> {
Thread t1 = new Thread(r1);
t1.start();
try {
t1.join();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("b");
};
Thread t2 = new Thread(r2);
t2.start();
try {
t2.join();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("c");
}
}