Java Exception MCQ

Programming Language > Java Programming Language

Test your knowledge of Java exceptions with these multiple choice questions. Learn about the different types of exceptions in Java and how to use them to handle errors and exceptional conditions in your programs. Take the quiz now! ➲ Java Exception MCQ - Quiz


  • A NumberFormatException
  • B ArithmeticException
  • C NullPointerException
  • D None of these
  • A try
  • B throwing
  • C catch
  • D throw
  • A catch
  • B throw
  • C throws
  • D finally
  • A java.util
  • B java.file
  • C java.io
  • D java.lang
  • A ArithmeticException
  • B Throwable
  • C Object
  • D Exception
  • A catch
  • B throws
  • C finally
  • D throw
  • A Either super or subclass can be caught first.
  • B The superclass exception must be caught first.
  • C The superclass exception cannot caught first.
  • D None of these
  • A ArrayElementOutOfBounds
  • B ArrayIndexOutOfBoundsException
  • C ArrayIndexOutOfBounds
  • D None of these
  • A IllegalStateException
  • B NumberFormatException
  • C ClassCastException
  • D ArrayIndexOutOfBoundsException
  • A There is a NullPointerException. Everything went fine.
  • B There is a NullPointerException.
  • C There is a NullPointerException. There is an Exception.
  • D This code will not compile, because in Java there are no pointers.
  • A ArrayIndexOutOfBoundsException is thrown
  • B ExceptionInInitializerError is thrown
  • C IllegalStateException is thrown
  • D StackOverflowException is thrown
  • A "one" is printed.
  • B "exception" is printed.
  • C "null pointer exception" is printed.
  • D Compilation fails saying NullPointerException has already been caught.
  • A java.util package
  • B java.lang package
  • C java.io package
  • D java.awt package