Hello Ranchers
please help me to slove the program below
1)class MyThread extends
Thread {
2) MyThread(){}
3)MyThread(Runnable r) {super(r);}
4)public void run() {System.out.print("Inside thead");}
5)}
6)class MyRunnable implements Runnable {
7) public void run() {System.out.print("Inside runnable");}
8)}
9)public class
Test {
10) public static void main(
String[] args){
11) new MyThread().start()
12) new MyThread(new MyRunnable()).start();
13)}
14)}
when i compile and Run iam getting output as
Inside thead Inside thead
my doubt is at line 12 Runnabler version of start() is called, and output
should be Inside thead Inside Runnable