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. It is used to return a detailed message about the exception that has occurred.

  2. It is used to fill the stack trace of object with the current stack trace, adding to any previous information in the stack trace.

  3. It is used to return the cause of the exception as represented by a Throwable object.

  4. It is not a method of exception in java.

  5. None of the above

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

This is true about fillInStackTrace() method in java exception.

Multiple choice
  1. By using a finally block allows you to run any cleanup-type statements .

  2. A finally keyword is used to create a block of code that follows a try block.

  3. A finally block appears at the end of the catch blocks.

  4. All of the above

  5. Both (1) and (2)

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

Yes, all are the true statement about the finally block.