The Thread class does not contain constructor which takes Object type as parameter so how it calls the constructor during multi-threading. Below is the code in which i need explanation.
Thread t = new Thread(myThread); //How this line execute.
class MyThread implements Runnable
{
@Override
public void run()
{
for(int i = 0; i < 1000; i++)
{
System.out.println(i+" * "+(i+1)+" = " + i * (i+1));
}
}
}
public class ThreadsInJava
{
//Main Thread
public static void main(String[] args)
{
MyThread myThread = new MyThread();
Thread t = new Thread(myThread);
t.start();
}
}