I am new to Java. I tried to find this grammar, but could not find it. Could you please indicate what it is?
class actions{ ... public ActionListener WHATISTHIS = new ActionListener () { public void actionPerformed (ActionEvent event) { String action = event.getActionCommand (); show_error ("Key unimplemented: " + action + ": " + keys.valueOf (action).get_html ()); refresh (action); } }; ...
Is WHATISTHIS an object of type ActionListener? And the stuff {..} after the new garbage code for the object? I'm confused. Usually I see something like:
[MODIFIER] [TYPE] obj = new [TYPE]();
But in the case above, this is:
[MODIFIER] [TYPE] obj = new [TYPE](){...};
source share