Question: Please fix any errors in code public class Main { public static void main ( String [ ] args ) { / / Create new

Please fix any errors in code
public class Main {
public static void main(String[] args){
// Create new instances of ThreadDemo:
ThreadDemo T1= new ThreadDemo(0, "Thread 1");
ThreadDemo T2= new ThreadDemo(5000, "Thread 2");
// Start up both ThreadDemo objects:
T1.start();
T2.start();
// Wait on the threads to finish.
try {
T1.join();
T2.join();
} catch (InterruptedException e){
System.out.println("Interrupted");
}
System.out.println("FINISHED");
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!