Tag: programming languages

Questions Related to programming languages

Do finally block get executed if the exception had not occurred?

  1. True

  2. False


Correct Option: A

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) True - This option is correct. The finally block is always executed, regardless of whether an exception occurred or not. It is typically used to release resources or perform cleanup actions that need to be done regardless of the outcome of the try-catch block.

Option B) False - This option is incorrect. The finally block is always executed, even if an exception did not occur.

The correct answer is A) True. This option is correct because the finally block will be executed regardless of whether an exception occurred or not.

  1. one

  2. two

  3. Compile error - char can't be permitted in switch statement

  4. Compile error - Illegal modifier for the class Test; only public, abstract & final are permitted


Correct Option: D
  1. An Error is a subclass of Throwable

  2. An Error is a subclass of Exception

  3. Error indicates serious problems that a reasonable application should not try to catch.

  4. An Error is a subclass of IOException


Correct Option: A,C
  1. Data Oriented Language

  2. Service Oriented Language

  3. Object Oriented Language

  4. Structured Oriented Language


Correct Option: C