Question: Which code is suitable to start a thread? class X implements Runnable { public static void main(String args[]) { /* Missing code? */ } public

Which code is suitable to start a thread? class X implements Runnable { public static void main(String args[]) { /* Missing code? */ } public void run() {} } What will be the output of the program? class MyThread extends Thread { public static void main(String [] args) { MyThread t = new MyThread(); t.start(); System.out.print("one."); t.start(); System.out.print("two."); } public void run() { System.out.print("Thread "); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
