Java Programming Fundamentals
Test your knowledge of Java programming basics including AWT event handling, object-oriented programming concepts, exception handling, and core language features.
Questions
Which event is generated when a component gains or loses input focus?
- Focus Event
- Keyboard Event
- Text Event
- Mouse Event
- None of these
______________ is generated by text fields and text areas when characters are entered by a user or program.
- Focus Event
- Item Event
- Text Event
- Either 1 or 2
- None of these
Which event is generated when a component is added to or removed from container?
- Item Event
- Container Event
- Adjustment Event
- Either Item Event or Adjustment Event
- None of these
Which method of Item Event can be used to obtain reference to the Item Selectable objects that generate an event?
- getItem()
- getItemSelectable()
- getStateChange()
- either getItem() or getStateChange()
- none of these
Which of the following exceptions is thrown when an application attempts to use null where an object is required?
- Arithmetic exception
- NullPointer exception
- ArrayIndexOutOfBounds exception
- All of these
- None of these
_____________ keyword is used to drive class from super class.
- Final
- Extend
- Abstract
- All of these
- None of these
______________ of the method is the data type of the value that is returned by the method.
- Access specifier
- The return_type
- The println()
- The main()
- None of these
_______________ exception is thrown when an attempt is made to access element beyond the index of the array.
- NullPointer exception
- Arithmetic exception
- ArrayIndexOutOfBounds exception
- Either 1 or 2
- None of these
Which component of an event is the object that generates the event?
- Event object
- Event source
- Event handler
- Either Event object or Event handler
- None of these
Which keyword is used to declare classes that defines common properties and behaviour of other classes?
- Abstract keyword
- Final keyword
- Extend keyword
- Either Final keyword or Extend keyword
- None of these