Two things bother me about Listing 24.4:
The listeners are defined in two different ways: one named and the other unnamed. This bothers me since it seems somehow untidy and asymmetric. At least it’s not pleasing to my eyes. Why not define an “enterButtonListener” right after the “numberButtonListener”?
The fact that there are two, almost identical, listeners bothers me as well. Is there a way to define one listener then determine in onClick which one it is? Then, use a switch statement to act on each one?