Courseiva
Knowledge + Practice
CertificationsVendorsCareer RoadmapsLabs & ToolsStudy GuidesGlossaryPractice Questions
C
Courseiva

Free IT certification practice questions with explained answers for CCNA, CompTIA, AWS, Azure, Google Cloud, and more.

Certification Practice Questions

CCNA practice questionsSecurity+ SY0-701 practice questionsAWS SAA-C03 practice questionsAZ-104 practice questionsAZ-900 practice questionsCLF-C02 practice questionsA+ Core 1 practice questionsGoogle Cloud ACE practice questionsCySA+ CS0-003 practice questionsNetwork+ N10-009 practice questions
View all certifications →

Product

CertificationsCertification PathsExam TopicsPractice TestsExam Dumps vs Practice TestsStudy HubComparisons

Company

AboutContactEditorial PolicyQuestion Writing PolicyTrust Center

Legal

Privacy PolicyTerms of Service

Courseiva is a free IT certification practice platform offering original exam-style practice questions, detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics for Cisco, CompTIA, Microsoft, AWS, and other technology certifications.

© 2026 Courseiva. Courseiva is operated by JTNetSolutions Ltd. All rights reserved.

Courseiva is an independent certification practice platform and is not affiliated with, endorsed by, or sponsored by Cisco, Microsoft, AWS, CompTIA, Google, ISC2, ISACA, or any other certification vendor. Vendor names and certification marks are used only to identify the exams learners are preparing for.

← Exception Handling and Development Tools practice sets

1Z0-811 Exception Handling and Development Tools • Complete Question Bank

1Z0-811 Exception Handling and Development Tools — All Questions With Answers

Complete 1Z0-811 Exception Handling and Development Tools question bank — all 0 questions with answers and detailed explanations.

61
Questions
Free
No signup
Certifications/1Z0-811/Practice Test/Exception Handling and Development Tools/All Questions
Question 1mediummultiple choice
Read the full Exception Handling and Development Tools explanation →

A developer writes a method that reads a file and processes its contents. If the file does not exist, the method should notify the caller. Which exception should the method declare in its throws clause?

Question 2hardmultiple choice
Read the full NAT/PAT explanation →

A team is developing a Java application that uses many third-party libraries. One library throws a checked exception that is not declared in its method signature. Which approach best handles this situation?

Question 3easymultiple choice
Read the full Exception Handling and Development Tools explanation →

Which of the following is the best practice for resource management in Java?

Question 4hardmultiple choice
Read the full NAT/PAT explanation →

A developer encounters an ArrayIndexOutOfBoundsException while running a unit test. The stack trace shows the error occurs in a method that is called from many places. Which tool or technique would most efficiently identify the specific call path?

Question 5easymultiple choice
Read the full Exception Handling and Development Tools explanation →

Which statement about the Java compiler is true?

Question 6mediummultiple choice
Read the full Exception Handling and Development Tools explanation →

A method throws a checked exception. Which of the following is the correct way to handle it in the calling method?

Question 7easymultiple choice
Read the full Exception Handling and Development Tools explanation →

Which command is used to run a Java application from the command line?

Question 8mediummulti select
Read the full Exception Handling and Development Tools explanation →

Which TWO statements about the finally block are true? (Choose two.)

Question 9hardmulti select
Read the full Exception Handling and Development Tools explanation →

Which THREE are checked exceptions in Java? (Choose three.)

Question 10mediummultiple choice
Read the full Exception Handling and Development Tools explanation →

Given the stack trace above, which line in MyClass.java caused the exception?

Exhibit

Refer to the exhibit.

```
Exception in thread "main" java.lang.NullPointerException
    at com.example.MyClass.process(MyClass.java:25)
    at com.example.Main.main(Main.java:10)
```
Question 11hardmultiple choice
Read the full Exception Handling and Development Tools explanation →

Given the compilation error above, which fix would resolve the error?

Exhibit

Refer to the exhibit.

```
$ javac MyApp.java
MyApp.java:5: error: unreported exception FileNotFoundException; must be caught or declared to be thrown
        FileReader fr = new FileReader("file.txt");
                        ^
1 error
```
Question 12hardmultiple choice
Read the full Exception Handling and Development Tools explanation →

You are a Java developer at a financial firm. The application processes transactions from a queue. The team recently migrated from Java 8 to Java 11. After the migration, the application intermittently throws an exception: 'java.lang.reflect.InaccessibleObjectException: Unable to make field private final byte[] java.lang.String.value accessible: module java.base does not 'opens java.lang' to unnamed module'. This error occurs when the application tries to use reflection to access private fields of String objects for serialization. The application runs on a server where you cannot modify the JVM startup scripts. However, you can modify the application code and the module-info.java file. You need to resolve the exception without breaking existing functionality. Which approach should you take?

Question 13mediumdrag order
Read the full Exception Handling and Development Tools explanation →

Arrange the steps to use a for loop to iterate over an array in Java in the correct order.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4
5Step 5
Question 14mediummatching
Read the full Exception Handling and Development Tools explanation →

Match each Java keyword to its use.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Prevents modification: variable constant, method override, class inheritance

Belongs to the class rather than instances

Cannot be instantiated; used for classes and methods

Ensures mutual exclusion in multithreading

Marks field to be ignored during serialization

Question 15mediummultiple choice
Read the full Exception Handling and Development Tools explanation →

A developer writes a method that reads a file and must ensure the file is closed even if an exception occurs. Which construct should be used?

Question 16easymultiple choice
Read the full Exception Handling and Development Tools explanation →

Which of the following exceptions is a checked exception?

Question 17hardmultiple choice
Read the full Exception Handling and Development Tools explanation →

A method declares throws FileNotFoundException and SQLException. Which statement about the caller is true?

Question 18mediummultiple choice
Read the full Exception Handling and Development Tools explanation →

What is the output if an ArithmeticException occurs in the try block and there is a finally block?

Question 19easymultiple choice
Read the full Exception Handling and Development Tools explanation →

Which command compiles a Java file and generates a .class file?

Question 20hardmultiple choice
Read the full Exception Handling and Development Tools explanation →

A custom exception class must extend which class to be a checked exception?

Question 21mediummultiple choice
Read the full Exception Handling and Development Tools explanation →

When using try-with-resources, which interface must the resource implement?

Question 22easymultiple choice
Read the full Exception Handling and Development Tools explanation →

What does the java command with -jar option do?

Question 23hardmultiple choice
Read the full Exception Handling and Development Tools explanation →

Given a method that catches Exception and then throws a RuntimeException, what is the effect?

Question 24mediummulti select
Read the full Exception Handling and Development Tools explanation →

Which TWO are benefits of using try-with-resources?

Question 25mediummulti select
Read the full Exception Handling and Development Tools explanation →

Which TWO are valid ways to handle a checked exception in a method?

Question 26hardmulti select
Read the full Exception Handling and Development Tools explanation →

Which THREE statements are true about the Java logging API (java.util.logging)?

Question 27mediummultiple choice
Read the full Exception Handling and Development Tools explanation →

Refer to the exhibit. A Java program throws a NullPointerException. Which is the most likely cause?

Exhibit

Exception in thread "main" java.lang.NullPointerException
    at com.example.MyClass.methodA(MyClass.java:25)
    at com.example.MyClass.main(MyClass.java:10)
Question 28hardmultiple choice
Read the full Exception Handling and Development Tools explanation →

Refer to the exhibit. A Java source file fails to compile with the given error. What change should be made to fix the error?

Exhibit

error: unreported exception java.io.IOException; must be caught or declared to be thrown
    br.readLine();
              ^
Question 29easymultiple choice
Read the full Exception Handling and Development Tools explanation →

Refer to the exhibit. Which statement is true about the InvalidInputException class?

Exhibit

public class InvalidInputException extends Exception {
    public InvalidInputException(String message) {
        super(message);
    }
}
Question 30easymultiple choice
Read the full Exception Handling and Development Tools explanation →

A developer writes a method that reads a file and parses its contents. Which exception handling approach is best practice for ensuring the file is properly closed even if an exception occurs?

Question 31mediummultiple choice
Read the full Exception Handling and Development Tools explanation →

A team is using a build tool to compile and package a Java application. They want to automatically run unit tests after compilation and before packaging. Which tool and configuration is most appropriate?

Question 32hardmultiple choice
Read the full Exception Handling and Development Tools explanation →

Consider a Java application that throws a NullPointerException deep inside a library method. The stack trace does not include the caller's line numbers because the library was compiled without debug information. Which approach would best help identify the root cause?

Question 33easymultiple choice
Read the full Exception Handling and Development Tools explanation →

A developer needs to handle a specific checked exception, FileNotFoundException, but also wants to catch any other IOException that might occur. Which catch block ordering is correct?

Question 34mediummultiple choice
Read the full Exception Handling and Development Tools explanation →

A developer is using the Oracle Java Platform Debugger Architecture (JPDA) to debug a remote Java application. Which command-line option is required to start the application in debug mode listening on port 5005?

Question 35hardmultiple choice
Read the full Exception Handling and Development Tools explanation →

A Java application uses a custom exception class that extends Exception. The application throws this exception from a method, but the method does not declare it in its throws clause. Which statement is true?

Question 36easymultiple choice
Read the full Exception Handling and Development Tools explanation →

Which tool is used to generate documentation comments from Java source code?

Question 37easymultiple choice
Read the full Exception Handling and Development Tools explanation →

A developer encounters a ClassNotFoundException at runtime. The class is present in the source code and compiles fine. Which is the most likely cause?

Question 38hardmultiple choice
Read the full Exception Handling and Development Tools explanation →

Given the following try-catch block: try { // some code

} catch (IOException | NumberFormatException e) {

e = new IOException("wrapper"); // throw e;

}

Which line causes a compilation error?

Question 39mediummulti select
Read the full Exception Handling and Development Tools explanation →

Which TWO statements are true about the finally block in exception handling? (Select exactly 2)

Question 40mediummulti select
Read the full Exception Handling and Development Tools explanation →

Which TWO command-line tools are included in the Oracle JDK for monitoring and troubleshooting Java applications? (Select exactly 2)

Question 41hardmulti select
Read the full Exception Handling and Development Tools explanation →

Which THREE statements about custom exceptions in Java are correct? (Select exactly 3)

Question 42mediummultiple choice
Read the full Exception Handling and Development Tools explanation →

Refer to the exhibit. Which action would best resolve this error without changing the code?

Exhibit

Exception in thread "main" java.io.FileNotFoundException: /data/config.txt (Permission denied)
        at java.base/java.io.FileInputStream.open0(Native Method)
        at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
        at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
        at com.example.ConfigLoader.load(ConfigLoader.java:35)
        at com.example.Main.main(Main.java:12)
Question 43easymultiple choice
Read the full Exception Handling and Development Tools explanation →

Refer to the exhibit. What does this warning indicate?

Exhibit

$ javac -d bin -cp lib/*.jar src/com/example/App.java
warning: [path] bad path element "lib/*.jar": No such file or directory
Question 44hardmultiple choice
Read the full Exception Handling and Development Tools explanation →

Refer to the exhibit. Which statement about this code is true?

Exhibit

public class ResourceHandler {
    public void process() throws IOException {
        try (FileInputStream fis = new FileInputStream("data.txt");
             BufferedReader br = new BufferedReader(new InputStreamReader(fis))) {
            // read file
        } catch (IOException e) {
            throw e;
        }
    }
}
Question 45mediummultiple choice
Read the full Exception Handling and Development Tools explanation →

A developer writes a method that reads a file and processes its contents. The method uses a BufferedReader wrapped around a FileReader. Which of the following approaches ensures that both resources are properly closed even if an exception occurs?

Question 46hardmultiple choice
Read the full Exception Handling and Development Tools explanation →

A team is designing a library that handles network timeouts. They create a custom exception `NetworkTimeoutException` that extends `Exception`. They want to ensure that callers are forced to handle this exception. Which declaration is appropriate for a method that throws this exception?

Question 47easymultiple choice
Read the full Exception Handling and Development Tools explanation →

A developer writes a catch block that handles multiple exception types that have a subclass relationship. Which of the following is a valid use of the multi-catch feature?

Question 48mediummultiple choice
Read the full Exception Handling and Development Tools explanation →

Consider the following code snippet:

public int getValue() {

try {

return 1;
    } catch (Exception e) {
        return 2;
    } finally {
        return 3;
    }
}

What does the method return?

Question 49hardmultiple choice
Read the full Exception Handling and Development Tools explanation →

A developer is using try-with-resources with a custom resource class that implements AutoCloseable. The class's close() method throws a custom exception `ResourceException`. In the try block, an IOException occurs. Which of the following best describes the exception that is propagated to the caller?

Question 50easymultiple choice
Read the full Exception Handling and Development Tools explanation →

A developer compiles a Java application using the command `javac -d bin src/com/example/App.java`. Which of the following is true?

Question 51mediummulti select
Read the full Exception Handling and Development Tools explanation →

Which TWO of the following are best practices for exception handling in Java?

Question 52hardmulti select
Read the full Exception Handling and Development Tools explanation →

Which TWO of the following development tools are specifically designed to analyze module dependencies or create custom runtime images?

Question 53easymulti select
Read the full Exception Handling and Development Tools explanation →

Which THREE of the following are checked exceptions in Java?

Question 54mediummultiple choice
Read the full Exception Handling and Development Tools explanation →

A developer tries to compile a modular Java application using the command shown in the exhibit. The compilation fails with the error shown. What is the most likely cause?

Network Topology
$ javac -d outmodule-source-path src -m com.example.appRefer to the exhibit.src/com.example.app/com/example/app/Main.java:5: error: cannot find symbolimport com.example.util.Helpersymbol: class Helperlocation: package com.example.util1 error
Question 55hardmultiple choice
Read the full NAT/PAT explanation →

You are a Java developer working on an enterprise application that uses a modular architecture with Java Platform Module System (JPMS). The application consists of several modules: `com.app.core`, `com.app.util`, `com.app.service`, and `com.app.client`. The application runs on a server that has Java 17 installed. Recently, the operations team reported that after a deployment, the application fails to start with a `NoClassDefFoundError` for a class in `com.app.util`, even though the class exists in the compiled module. The deployment process uses a custom script that compiles the modules using `javac` with `--module-source-path`, then uses `jlink` to create a custom runtime image that includes only the required modules. The runtime image is then deployed to the server. The build logs show no errors during compilation or linking. However, on the server, the error occurs. The server has multiple versions of the same library on the classpath due to legacy scripts. You suspect that the error is due to a module resolution issue. Which corrective action should you take?

Question 56easymultiple choice
Read the full Exception Handling and Development Tools explanation →

You are a junior developer tasked with generating API documentation for a large Java project. The project uses Javadoc comments extensively, and you need to generate HTML documentation that includes all public and protected classes and methods. You have access to the source files in the `src` directory, and you want the output to be placed in a `docs` folder. Additionally, you want to include a custom header and footer in each generated page. The project uses multiple packages like `com.example.app`, `com.example.util`, and `com.example.data`. You plan to run the javadoc command from the project root. Which command should you use?

Question 57mediummultiple choice
Read the full Exception Handling and Development Tools explanation →

You are maintaining a multi-threaded banking application that processes transactions. In the `processTransaction` method, you have a try-catch block that catches `Exception` to handle any unexpected errors. Recently, the application intermittently fails to update account balances correctly due to unhandled exceptions. The logs show that sometimes a `RuntimeException` is thrown from a nested method, but it is not being logged or handled properly, leading to inconsistent state. The team wants to improve the exception handling to ensure that all exceptions are caught, logged, and the transaction is rolled back properly. The method currently uses a primitive try-catch-finally where the finally block commits the transaction if no exception occurred. Which approach best addresses the issue while maintaining clarity and correctness?

Question 58mediummultiple choice
Read the full NAT/PAT explanation →

You are responsible for deploying a Java desktop application that uses JavaFX and various third-party libraries. The application is modular and uses JPMS. To reduce the footprint and startup time, you decide to use jlink to create a custom runtime image that includes only the required modules. The application has a main module `com.myapp` that requires `javafx.controls`, `javafx.base`, and some other modules. After creating the runtime image using the command `jlink --module-path $JAVA_HOME/jmods:lib --add-modules com.myapp --output myapp-image`, you test the image on a development machine, and it works. However, when deploying to a customer's machine, the application fails to start with an error: "Error: Could not find or load main class com.myapp.Main". The customer's machine has no Java installed. The runtime image includes the `com.myapp` module. You verify that the `myapp-image/bin/java` launcher exists. The main class is correctly declared in the module-info.java of `com.myapp`. What is the most likely cause of this error?

Question 59mediummulti select
Read the full Exception Handling and Development Tools explanation →

A developer is debugging a Java application that throws a NullPointerException. Which two actions help identify the source of the exception? (Choose two.)

Question 60hardmultiple choice
Read the full Exception Handling and Development Tools explanation →

Refer to the exhibit. A developer encounters this exception when running the application. The method divide is intended to handle division by zero. What is the most likely cause of the exception?

Exhibit

Exception in thread "main" java.lang.ArithmeticException: / by zero
	at com.example.Calculator.divide(Calculator.java:12)
	at com.example.Main.main(Main.java:5)
Question 61easymultiple choice
Read the full NAT/PAT explanation →

A developer is maintaining a Java backend service for order processing. The service uses a third-party library that throws a checked PaymentException when a payment fails. The current processOrder method catches Exception generically, logs the error, and returns null. The business requires that when a payment fails, the order status must be updated to 'FAILED' in the database, and a notification must be sent to the customer. However, due to the generic catch, these actions are not performed. The developer must modify the code to meet the business requirements without changing the external API of the class (i.e., the method signature must remain the same and must not throw any exceptions to the caller). Which course of action should the developer take?

Practice tests

Scored 10-question sessions with instant feedback and explanations.

1Z0-811 Practice Test 1 — 10 Questions→1Z0-811 Practice Test 2 — 10 Questions→1Z0-811 Practice Test 3 — 10 Questions→1Z0-811 Practice Test 4 — 10 Questions→1Z0-811 Practice Test 5 — 10 Questions→1Z0-811 Practice Exam 1 — 20 Questions→1Z0-811 Practice Exam 2 — 20 Questions→1Z0-811 Practice Exam 3 — 20 Questions→1Z0-811 Practice Exam 4 — 20 Questions→Free 1Z0-811 Practice Test 1 — 30 Questions→Free 1Z0-811 Practice Test 2 — 30 Questions→Free 1Z0-811 Practice Test 3 — 30 Questions→1Z0-811 Practice Questions 1 — 50 Questions→1Z0-811 Practice Questions 2 — 50 Questions→1Z0-811 Exam Simulation 1 — 100 Questions→

Practice by domain

Each domain maps to a weighted exam section. Focus on the domain where you are weakest.

What is JavaJava Basics and SyntaxPrimitives, Strings and OperatorsControl Flow and LoopsArrays and MethodsObject-Oriented ProgrammingException Handling and Development Tools

Practice by scenario

Filter questions by type — troubleshooting, exhibit, drag-and-drop, PBQ, ACLs, OSPF, and more.

Browse scenarios→

Continue studying

All Exception Handling and Development Tools setsAll Exception Handling and Development Tools questions1Z0-811 Practice Hub