I have the following code
public static void main(String[] args) {
new Thread() {
public void run() {
try {
employee1();
} catch (Exception e) {
Logger.LogServer(e);
}
finally {
Logger.LogServer("empployee1 records inserted");
}
}
}.start();
new Thread() {
public void run() {
try {
employee2();
} catch (Exception e) {
Logger.LogServer(e);
}
finally {
Logger.LogServer("employee2 records inserted");
}
}
}.start();
}
I want to wait for both the treads to finish execution and then exit the application with System.exit(0);
. How can i achieve this?
Can someone please assist me.