Why do some people prefer to use
.setCommandListener(this)
over
.setCommandListener(new CommandListener(){})
more often? In what case should I use the second one and why?
I am assuming it’s just a matter of style or is there a particular issue?
If you use “this”, you must implement the listener to the class, and then you can access fields of class in the implemented methods of listener.
If you use the second one(new Listener…) then it might be more readable code if you don’t need to access many other stuff in your class.