Here's a class that extends the Thread class and overrides the run method:
class MyThread extends Thread {
public MyThread(String name) {
super(name);
}
@Override
public void run() {
System.out.println("Hello from " + getName());
}
}
Take a look at a code snippet:
MyThread t1 = new MyThread("My-thread-1");
t1.start();
MyThread t2 = new MyThread("My-thread-2");
t2.start();
System.out.println("Finished");
Select the correct statement about the order of lines in the output: