Java Programming Fundamentals

Test your knowledge of Java programming basics including AWT event handling, object-oriented programming concepts, exception handling, and core language features.

10 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which event is generated when a component gains or loses input focus?

  1. Focus Event
  2. Keyboard Event
  3. Text Event
  4. Mouse Event
  5. None of these
Question 2 Multiple Choice (Single Answer)

______________ is generated by text fields and text areas when characters are entered by a user or program.

  1. Focus Event
  2. Item Event
  3. Text Event
  4. Either 1 or 2
  5. None of these
Question 3 Multiple Choice (Single Answer)

Which event is generated when a component is added to or removed from container?

  1. Item Event
  2. Container Event
  3. Adjustment Event
  4. Either Item Event or Adjustment Event
  5. None of these
Question 4 Multiple Choice (Single Answer)

Which method of Item Event can be used to obtain reference to the Item Selectable objects that generate an event?

  1. getItem()
  2. getItemSelectable()
  3. getStateChange()
  4. either getItem() or getStateChange()
  5. none of these
Question 5 Multiple Choice (Single Answer)

Which of the following exceptions is thrown when an application attempts to use null where an object is required?

  1. Arithmetic exception
  2. NullPointer exception
  3. ArrayIndexOutOfBounds exception
  4. All of these
  5. None of these
Question 6 Multiple Choice (Single Answer)

_____________ keyword is used to drive class from super class.

  1. Final
  2. Extend
  3. Abstract
  4. All of these
  5. None of these
Question 7 Multiple Choice (Single Answer)

______________ of the method is the data type of the value that is returned by the method.

  1. Access specifier
  2. The return_type
  3. The println()
  4. The main()
  5. None of these
Question 8 Multiple Choice (Single Answer)

_______________ exception is thrown when an attempt is made to access element beyond the index of the array.

  1. NullPointer exception
  2. Arithmetic exception
  3. ArrayIndexOutOfBounds exception
  4. Either 1 or 2
  5. None of these
Question 9 Multiple Choice (Single Answer)

Which component of an event is the object that generates the event?

  1. Event object
  2. Event source
  3. Event handler
  4. Either Event object or Event handler
  5. None of these
Question 10 Multiple Choice (Single Answer)

Which keyword is used to declare classes that defines common properties and behaviour of other classes?

  1. Abstract keyword
  2. Final keyword
  3. Extend keyword
  4. Either Final keyword or Extend keyword
  5. None of these