I have often come across this snippet :
General form of invokeLater is - static void invokeLater(Runnable obj)
But i have often come across these types of codes:
{
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new tester();
}
});
}
or-----(example of another type)
{
clean.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae) {
cleanActionPerformed(ae);
}
});
}
Now what is this? There is method in the constructor!! I am unable to understand the way of writing these snippets. Explain very clearly