Computer Knowledge

Java Core Classes and Threads

1,935 Questions

Java core classes and threads form the foundation of object oriented programming and are crucial for IT officer and programming exams. This includes concepts like string mutability, collections, and multithreading. Solve these questions to test your practical coding and theoretical knowledge.

String and StringBuffer classesThread execution methodsJava collections frameworkCharacter streams input outputVariable serialization rules

Java Core Classes and Threads Questions

Multiple choice
  1. getInitParameter(String name)

  2. getInitParameterNames()

  3. addHeader(java.lang.String name, java.lang.String value)

  4. contains header(java.lang.String name)

  5. setHeader(java.lang.String name, java.lang.String value)

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

It returns the name of the Servlet's initialization attributes as an enumeration of String objects.

Multiple choice
  1. Implement the click interfaces in your activity and pass in this when registering a click listener.

  2. Extends the click interfaces in your activity and pass in this when registering a click listener.

  3. Implement the click listner interfaces in your activity and pass in this when registering a click listener.

  4. Implement the click interfaces in anywhere and pass in this when registering a click listener.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

To avoid creating anonymous classes for click handling, you can Implement the click interfaces in your activity and pass in this when registering a click listener.

Multiple choice
  1. onLongPress

  2. onPressListner

  3. onLongPressListener

  4. onLongClick

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

A long press is triggered when the user taps and holds on the screen. Long Presses are handled by registering an onLongPressListener.Other than the name, the setup of a long press listener is exactly the same a standard click listener.