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

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

University

20 Qs

quiz-placeholder

Similar activities

Exception handling -oracle plsql

Exception handling -oracle plsql

University

15 Qs

c++

c++

University

22 Qs

MODULE 4

MODULE 4

University

22 Qs

DATABASE

DATABASE

University

20 Qs

5-mavzu

5-mavzu

University

17 Qs

PL SQL

PL SQL

University - Professional Development

20 Qs

Java Programming

Java Programming

University

20 Qs

JavaScript Basics

JavaScript Basics

12th Grade - University

15 Qs

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

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

Assessment

Quiz

Computers

University

Easy

Created by

Darwin Vargas

Used 5+ times

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?