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. Volatile keyword is used to achieve synchronization in java.

  2. Volatile keyword determines that the volatile variable reads the value form the main memory only.

  3. Volatile variable is used in a multithreading environment.

  4. All of the above

  5. Only (2) and (3)

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

Yes, all of the above three are the true statements about the volatile variable in java.

Multiple choice
  1. A TreeSet class maintains the ascending order of the elements.

  2. ArrayList class provides random access of the elements.

  3. ArrayList is not synchronized.

  4. HashMap class can not have any null key.

  5. None of the above

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

This is not a true statement, as HashMap class can have one null key and multiple null values.