I have the following code snippet:
public class A { public static void main(String[] arg) { new Thread() { public void run() {
Add: now you can use lambda to simplify your syntax. Requirement: Java 8+
public class A { public static void main(String[] arg) { Thread th = new Thread(() -> {System.out.println("blah");}); th.start(); } }