package com.timbuchalka; public class Main { public static void main(String[] args) { System.out.println("Hello from the main thread."); String name = Thread.currentThread().getName(); System.out.println(name); Thread anotherThread = new AnotherThread(); anotherThread.start(); new Thread() { public void run() { System.out.println( "Hello from the anonymous class thread"); } }.start(); Thread myRunnableThread = new Thread(new MyRunnable() { @Override public void run() { System.out.println( "Hello from the anonymous class's implementation of run()"); } }); myRunnableThread.start(); System.out.println("Hello again from the main thread."); } }