0
Is there anything wrong in this question.? Why this stupid solo learner app keep on rejecting it..!
guess the out put. Class MyThread extends Thread{ public void run(int i) { System.out.print ("i"); } } Class ThreadDemo{ public static void main(String[] args){ MyThread t = new MyThread(); t.start(); } No output. is the answer..!
1 Réponse
0
explanation :
when child thread got initiated it will only execute run method, of MyThread class, with no parameters. As MyThread extends Thread class it also extends empty run method, of Thread Class, with no parameters. So, the run method with parameter "int i" will never get a chance to run. And there will be no out put.