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. To initialize the string to all nulls or to any character

  2. To find the next token in a string

  3. To compare two strings

  4. To append a source string to the end of a destination string

  5. To return the length of a string, not counting the null characters at the end

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

memset() is used to initialize the string.

Multiple choice
  1. 2

  2. 3

  3. 4

  4. 5

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

Java has two main types of threads: user threads and daemon threads. User threads are created by the application and prevent the JVM from exiting until they complete. Daemon threads run in the background and don't prevent JVM exit - they terminate when all user threads finish. The question asks for 'types' rather than specific thread priorities or states.