Java Programming Fundamentals

Covers core Java concepts including threading, string manipulation, event handling, I/O streams, and basic application programming.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following methods of ThreadClass in Java determines if a thread is still running or not?

  1. getName
  2. isAlive
  3. join
  4. none of these
Question 2 Multiple Choice (Single Answer)

Which of the following methods in interthread communication in Java wakes up all the threads that called wait() on the same object?

  1. wait()
  2. notify()
  3. notifyAll()
  4. none of these
Question 3 Multiple Choice (Single Answer)

Which of the following interfaces in Java beans consists of methods that are used to initialise beans, which are also applets?

  1. BeanInfo
  2. Customizer
  3. AppletInitializer
  4. None of these
Question 4 Multiple Choice (Single Answer)

Which of the following methods in string class of Java is used to extract more than one character at a time?

  1. charAt()
  2. toCharArray()
  3. getChars()
  4. none of these
Question 5 Multiple Choice (Single Answer)

Which of the following methods of StringBuffer class is used to pre-allocate room for a certain number of characters?

  1. ensureCapacity()
  2. capacity()
  3. length()
  4. none of these
Question 6 Multiple Choice (Single Answer)

Which of the following methods of Thread class is used to resume execution of all threads waiting on the invoking object?

  1. notify()
  2. notifyAll()
  3. hashCode()
  4. none of these
Question 7 Multiple Choice (Single Answer)

The textChanged() method in Java belongs to ____________ interface.

  1. WindowListener
  2. TextListener
  3. MouseMotionListener
  4. None of these
Question 8 Multiple Choice (Single Answer)

Which of the following event listener interfaces in Java defines one method to receive adjustment events?

  1. ActionListener
  2. ItemListener
  3. AdjustmentListener
  4. TextListener
Question 9 Multiple Choice (Single Answer)

Which of the following events is generated when an user enters a character?

  1. Button
  2. Choice
  3. Text component
  4. None of these
Question 10 Multiple Choice (Single Answer)

Which of the following attributes is required that gives the name of the file containing the applets compiled .class file in Java?

  1. CODEBASE
  2. CODE
  3. ALT
  4. None of these
Question 11 Multiple Choice (Single Answer)

Which of the following event classes is generated when a component gains or loses input focus?

  1. FocusEvent class
  2. ContainerEvent class
  3. ComponentEvent class
  4. None of these
Question 12 Multiple Choice (Single Answer)

Which of the following event classes is generated when input is received from the keyboard?

  1. KeyEvent
  2. MouseEvent
  3. TextEvent
  4. WindowEvent
Question 13 Multiple Choice (Single Answer)

Which of the following stream classes in Java is an output stream that contains methods for writing the Java standard data types?

  1. DataInputStream
  2. DataOutputStream
  3. PushbackInputStream
  4. None of these
Question 14 Multiple Choice (Single Answer)

Which of the following character options is used in a JAR file to create a new archive?

  1. 'C'
  2. 'c'
  3. 'u'
  4. 'v'
Question 15 Multiple Choice (Single Answer)

Which of the following stream classes in Java is an input stream that reads data from a file?

  1. FileReader
  2. FileWriter
  3. PrintWriter
  4. None of these