Advance Java Programming Prilim Exam

64 Questions | Total Attempts: 581

SettingsSettingsSettings
Advance Java Programming Prilim Exam - Quiz


Questions and Answers
  • 1. 
    Which of these packages contains all the classes and methods required for even handling in Java?
    • A. 

      Java.applet

    • B. 

      java.awt

    • C. 

      Java.event

    • D. 

      java.awt.event

  • 2. 
    Which of these methods are used to register a mouse motion listener?
    • A. 

      addMouse()

    • B. 

      addMouseListener()

    • C. 

      AddMouseMotionListner()

    • D. 

      EventMouseMotionListener()

  • 3. 
    What is a listener in context to event handling?
    • A. 

      A listener is a variable that is notified when an event occurs.

    • B. 

      A listener is a object that is notified when an event occurs.

    • C. 

      A listener is a method that is notified when an event occurs.

    • D. 

      None of the mentioned

  • 4. 
    Which of these methods can be used to determine the type of event? 
    • A. 

      GetID()

    • B. 

      GetSource()

    • C. 

      GetEvent()

    • D. 

      GetEventObject()

  • 5. 
    Which of these are integer constants defined in ActionEvent class? 
    • A. 

      ALT_MASK

    • B. 

      CTRL_MASK

    • C. 

      SHIFT_MASK

    • D. 

      All of the mentioned

  • 6. 
    Which of these methods can be used to determine the type of adjustment event? 
    • A. 

      getType()

    • B. 

      GetEventType()

    • C. 

      GetAdjustmentType()

    • D. 

      GetEventObjectType()

  • 7. 
    Which of these constant value will change when the button at the end of scroll bar was clicked to increase its value? 
    • A. 

      BLOCK_DECREMENT

    • B. 

      BLOCK_INCREMENT

    • C. 

      UNIT_DECREMENT

    • D. 

      UNIT_INCREMENT

  • 8. 
    Which of these is superclass of all Adapter classes? 
    • A. 

      Applet

    • B. 

      Component

    • C. 

      Event

    • D. 

      InputEvent

  • 9. 
    JLabel(String s,Icon i,int align) the align argument can be
    • A. 

      LEFT,RIGHT,CENTER,LEADING,TRAILING

    • B. 

      RIGHT,LEFT,CENTER,TOP,BOTTOM

    • C. 

      TOP,BOTTOM,CENTER

    • D. 

      EAST,WEST,NORTH,SOUTH

  • 10. 
    • A. 

      URL Class

    • B. 

      URLConnection Class URLConnection Class URLConnection Class

    • C. 

      Connection Class

    • D. 

      ConnectionUrl Class

  • 11. 
     which AWT component is used to create popup list of string items from which only one can be selected at a time. 
    • A. 

      List

    • B. 

      Choice

    • C. 

      MenuBar

    • D. 

      Scrollbar

  • 12. 
    Which is the passive control 
    • A. 

      Checkbox

    • B. 

      Scrollbar

    • C. 

      Label

    • D. 

      Button

  • 13. 
    Select appropriate code for the given output 
    • A. 

      Code1

    • B. 

      Code2

    • C. 

      Code3

    • D. 

      Code4

  • 14. 
    Which method is used to display icon on a component?  
    • A. 

      RollOverIcon(ImageIcon i)

    • B. 

      SetIcon(ImageIcon i)

    • C. 

      DisplayIcon(ImageIcon i)

    • D. 

      RemoveIcon (ImageIcon i )

  • 15. 
    Identify the error in given program
    • A. 

      Error in statement in which JScrollPane is created

    • B. 

      Error in statement in which applet tag is declared

    • C. 

      Error in statement in which JTable is created

    • D. 

      None of the above

  • 16. 
    What is output of the given code?
    • A. 

      Only button OK is displayed

    • B. 

      Only button Cancel is displayed.

    • C. 

      Both button OK and button Cancel are displayed and button OK is displayed on the left side of button OK

    • D. 

      Both button OK and button Cancel are displayed and button OK is displayed on the right side of button OK.

  • 17. 
    How many types of controls does AWT supports these controls are subclasses of component?
    • A. 

      5

    • B. 

      7

    • C. 

      6

    • D. 

      8

  • 18. 
    Identify missing statements in given program
    • A. 

      AdjustmentPerformed(AdjustmentEvent ae);

    • B. 

      ItemStateChanged(ItemEvent ie);

    • C. 

      ItemStateChanged(ActionEvent ie);

    • D. 

      ActionPerformed(ActionEvent ae);

  • 19. 
    Identify components used in below output
    • A. 

      Applet, Label TextField

    • B. 

      Label, TextField, Button

    • C. 

      Applet, Button TextField

    • D. 

      Grid Layout, Label, Button

  • 20. 
    What is the purpose of Jtable?
    • A. 

      JTable object displays rows and columns of data.

    • B. 

      JTable object displays rows of data with header.

    • C. 

      JTable object displays columns of data

    • D. 

      JTable object displays data in Table form with header detail.

  • 21. 
     identify the components used in given output:
    • A. 

      TabbedPane, List, Applet

    • B. 

      Panel, TabbedPane, List

    • C. 

      Label, TabbedPane, CheckBox

    • D. 

      Applet, TabbedPane, Panel

  • 22. 
    Select proper output?
    • A. 

      Output1

    • B. 

      Output2

    • C. 

      Syntax Error In Program

    • D. 

      Run Time Exception in Program

  • 23. 
    What is Purpose of Jtree ?
    • A. 

      Tree is used to display icon

    • B. 

      Tree is used display button

    • C. 

      Tree is used for Label

    • D. 

      A tree is a component that presents a hierarchical view of elements

  • 24. 
    In event handling, A listener is a object that is notified when an event occurs.
    • A. 

      True

    • B. 

      False

  • 25. 
    ----------------------is a superclass for push button,checkboxes and radiobutton
    • A. 

      Button

    • B. 

      ScrollButton

    • C. 

      AbstractButton

    • D. 

      None

Back to Top Back to top