x

JSP Events Questions

JSP Events Questions:


This topic is part of SCJP 1.2 exam but not SCJP 1.4 exam.

  1. Name the method defined in EventObject class that returns the Object generated from the event. Select the one correct answer.
    1. getEvent()
    2. getObject()
    3. getID()
    4. getSource()
  2. What is the return type of the method getID() defined in AWTEvent class. Select the one correct answer.
    1. int
    2. long
    3. Object
    4. Component
    5. short
  3. Name the event that gets generated when a button is clicked. Select the one correct answer.
    1. KeyEvent
    2. MouseEvent
    3. ItemEvent
    4. ActionEvent
  4. Which event is generated when the position of a scrollbar is changed. Select the one correct answer.
    1. KeyEvent
    2. MouseEvent
    3. ItemEvent
    4. ActionEvent
    5. AdjustmentEvent
  5. Which of the following Objects can generate ActionEvent. Select the one correct answer.
    1. List
    2. TextArea
    3. CheckboxMenuItem
    4. Choice
  6. Which of the following Objects can generate ItemEvent. Select the two correct answer.
    1. CheckBox
    2. C++ Decision Control StatementsButton
    3. List
    4. MenuItem
  7. Which method identifies the type of an event generated. Select the one correct answer.
    1. getSource()
    2. getType()
    3. getEventType()
    4. getID()
  8. Which of the following are legal adapter classes in Java. Select the two correct answers.
    1. ActionAdapter
    2. ItemAdapter
    3. TextAdapter
    4. MouseAdapter
    5. MouseMotionAdapter
  9. Name the class of the argument of method actionPerformed() defined in the ActionListener interface.
  10. Which of these listener classes have corresponding adapter classes. Select the two correct answers.
    1. ContainerListener
    2. TextListener
    3. ItemListener
    4. MouseMotionListener
  11. Which of these are valid adapter classes. Select the one correct answer.
    1. ActionAdapter
    2. AdjustmentAdapter
    3. KeyAdapter
    4. TextAdapter
  12. Which of these methods are defined in MouseMotionlistener interface. Select the two correct answers.
    1. mouseClicked()
    2. mousePressed()
    3. mouseEntered()
    4. mouseDragged()
    5. mouseMoved()
  13. What is the return type of the method getSource() defined in EventObject class. Select the one correct answer.
    1. int
    2. long
    3. Object
    4. Component
    5. short

Answers to questions on Events


  1. d
  2. a
  3. d
  4. e
  5. a
  6. a, c
  7. d
  8. d, e
  9. ActionEvent
  10. a, d
  11. c
  12. d, e
  13. c


Like it? Please Spread the word!