Search Header Logo

Week 9-10 PC8 Exception Handling & File I/O Quiz

Authored by Darwin Vargas

Computers

University

Used 5+ times

Week 9-10 PC8 Exception Handling & File I/O Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary purpose of exception handling in Java?

To improve program speed

  • To manage errors and prevent program crashes

  • To optimize memory usage

  • To automatically fix bugs

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which block of code is always executed, regardless of whether an exception is thrown?

  • try

  • catcH

  • finally

  • throw

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used to manually throw an exception in Java?

  • catch

  • throw

  • finally

  • try

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following classes is used to read data from a text file efficiently?

  • FileWriter

  • FileReader

  • BufferedReader

  • Scanner

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Exception propagation occurs when:

  • An exception is caught in the same method where it was thrown

  • An exception moves up the call stack if not handled

  • An exception is ignored by the compiler

  • An exception is automatically resolved

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to handle multiple exceptions in Java?

  • Multiple try blocks

  • Multiple catch blocks

  • Multiple finally blocks

  • Multiple throw blocks

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Custom exceptions are created by:

Implementing the Throwable interface

  • Extending the Exception class

  • Using the 'throw' keyword

  • Overloading the catch block

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?