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. If exception then exception handling statements

  2. If raised_exception then exception handling statements

  3. When exception then exception handling statements

  4. When raised_exception then exception handling statements

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

Exception handling prevents the program from abnormal termination. If a program encounters an exception/run time error, the control moves to the exception part where it is handled using the 'when exception then' keyword. For example: To handle a user defined exception, the statement will beĀ  when no_data_found then dbms_output.put_line('No Records Found');

Multiple choice
  1. The upcoming exception needs more than one handler.

  2. Different upcoming exceptions can be filtered out different types of problems.

  3. Single up coming exception can be filtered out different types of problems.

  4. Different upcoming exceptions can be combined to have one problem only.

  5. None of the above

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

Exception Handlers in ASP.NET program are overlapped in many applications since different upcoming exception can be filtered out different type of problems.

Multiple choice
  1. Unboxing can throw InvalidCastException at runtime.

  2. In boxing, a copy of the value type is taken from the heap to the stack.

  3. In unboxing, a copy of the value type is taken back from the heap to the stack.

  4. Casting does not physically move or operate on the object.

  5. Both (2) and (4).

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

This is false as boxing refers to take the value type from the stack to the heap.