class Medical extends Thread {
public void run() {
System.out.println("Medical Started");
try {
Thread.sleep(5000);
System.out.println("medical completed");
System.out.println("----------------------------------------");
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
class TestDrive extends Thread {
public void run() {
System.out.println("Test Drive Started");
try {
Thread.sleep(3000);
System.out.println("test driver passed safely");
System.out.println("-----------------------------------------------");
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
class OfficerSign extends Thread {
public void run() {
System.out.println("File handed over to Officer");
try {
Thread.sleep(1000);
System.out.println("officer signed the documents");
System.out.println("-----------------------------------------------");
Thread.sleep(1000);
System.out.println("Licence process completed");
} catch (Exception e) {
e.printStackTrace();
}
}
}
public class LicenceDemo {
public static void main(String[] args) {
try {
Medical med = new Medical();
med.start();
med.join();
TestDrive td = new TestDrive();
td.start();
td.join();
OfficerSign os = new OfficerSign();
os.start();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}