Is there any way to start a thread without extending class Thread and implementing Runnable interface.
For eg. Consider the code below:
public static void main(String arg)
Thread t = new Thread();
public void run()
System.out.println("in run of main");
System.out.println("t thread exiting");
The code above neither extends Thread class or nor implements Runnable interface, even then i am able to create a thread but when i call start() method
the run() is not getting called as i haven't provided the target.
Is there any way to get this work without using Runnable or Extending Thread?