Say I\'m using a Runnable interface,
Runnable runnable = new Runnable() { @Override public void run() { // some code } };