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. IllegalArgumentException

  2. NullPointerException

  3. IOException

  4. IndexOutOfBoundException

  5. ArithmeticException

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

IOException is not a subclass of RuntimeException class, this class is a Subclass of Exception class.This exception is thrown when invalid input/output are given.So this is the correct answer as this is not a subclass of RuntimeException class.

Multiple choice
  1. Throwable is the superclass of all exception classes in Java.

  2. Stack overflow is an example of runtime exception.

  3. Checked exceptions occurr due to user error.

  4. Finally clause is used to free the resources allocated by the methods in the beginning of the program.

  5. All of the above

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

This is a false statement as it is not an exception. It is an error.