Tag: technology

Questions Related to technology

  1. D

  2. E

  3. A

  4. Both D and E


Correct Option: D
Explanation:

To solve this question, the user must understand the concepts of try-catch blocks and the order of exception handling.

The code first initializes two integer variables, i and j, both with the value 1. It then enters a try block where it increments i by 1 and decrements j by 1. If i and j are equal, it increments i by 1 again. However, this condition is not met, so the code skips over the try block and proceeds to the finally block, where it prints out 3. It then prints out 4.

The correct answer is D) Both D and E, because the code will output 3 and 4. The try block does not throw any exceptions, so none of the catch blocks are executed. The finally block is always executed, regardless of whether an exception is thrown or not. Therefore, the output will be 3 (from the finally block) and 4 (from the last print statement).

  1. Pack the laptop in a heavy cardboard box with loads of crumpled newspaper.

  2. Pack the laptop in a laptop carry case

  3. Pack the laptop in a hard case that is lined with internal padding

  4. Pack the laptop amongst large pieces of styrofoam.


Correct Option: C
  1. if((i == 0) || (j/i == 1))

  2. if((i == 0) | (j/i == 1))

  3. if((i != 0) && (j/i == 1))

  4. if((i != 0) & (j/i == 1))


Correct Option: B,D