Tag: programming languages

Questions Related to programming languages

  1. Divide by zero error

  2. Accessing the elements of an array beyond its range

  3. Invalid input

  4. Opening an empty file

  5. Hard disk crash


Correct Option: A,B,C,E
  1. Checked exceptions must be explicitly caught or propagated(declared Thrown)

  2. Unchecked exceptions must be explicitly caught or propagated(declared Thrown)

  3. Checked exceptions in Java extend the java.lang.Exception class

  4. Unchecked exceptions extend the java.lang.RuntimeException class


Correct Option: A,C,D
  1. Errors

  2. Exceptions

  3. Both errors and exceptions

  4. Neither


Correct Option: B
  1. No. You can write a program to catch just the exceptions you want.

  2. No. But if a program catches one type of exception it must catch all other types as well.

  3. Yes. If a program is not written to catch all exceptions it will not compile.

  4. Yes. A program can not do I/O unless it catches all exceptions.


Correct Option: A

Class Exception is the superclass of all exceptions

  1. True

  2. False


Correct Option: B
  1. an IntegerArithmeticException

  2. an ArithmeticException

  3. a DivideByZeroException

  4. a NumberFormatException


Correct Option: B