What do the curly braces do there ?
handler1 = new Handler() { public void handleMessage() { } };
object = new Class
This is the syntax for creating an instance of anonymous class that extends Handler. This is part of Java.
Handler