Which of the following lines of output are displayed by the following program?
public class Main { public static void main(String args[]) { MyThread t = new MyThread(); t.displayOutput("t has been created."); t.start();// w w w .j a v a 2 s . c o m } } class MyThread extends Thread { public void displayOutput(String s) { System.out.println(s); } public void run() { displayOutput("t is running."); } }
A and B.
Both A and B are displayed.