Quiz

After the LottoMadness program has soured you on games of chance, play a game of skill by answering the following questions.

Questions

1:Why are action events called by that name?
  1. They occur in reaction to something else.

  2. They indicate that some kind of action should be taken in response.

  3. They honor cinematic adventurer Action Jackson.

2:What does this signify as the argument to an addActionListener() method?
  1. This listener should be used when an event occurs.

  2. This event takes precedence over others.

  3. This object will handle the events.

3:Which component stores user input as integers?
  1. JButton

  2. JTextField

  3. Neither does.

Answers

A1: b. Action events include the click of a button and the selection of an item from a pull-down menu.
A2: c. The this keyword ...

Get SAMS Teach Yourself Programming with Java™ in 24 Hours, FOURTH EDITION now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.