class MyThread extends Thread {
public void run() {
System.out.println("Thread is running...");
}
}
Then create and start the thread using: new MyThread().start();
class MyRunnable implements Runnable {
public void run() {
System.out.println("Runnable thread running...");
}
}
To execute: new Thread(new MyRunnable()).start();