You must read stack traces to pinpoint the throwing line, decide whether an exception is checked or unchecked, and know that callers of a method declaring checked exceptions must catch or re-declare them. The single most important skill is mapping a stack trace's first frame to the exact source line.
Start practicing
Exception Handling and Development Tools — choose a session length
Free · No account required
Domain overview
This domain covers Java exception handling and core JDK tooling on the 1Z0-811 exam. Questions show stack traces, thrown checked exceptions, and javac/java commands, then ask you to identify the cause, the failing line, the compile output location, or the caller's obligation. Expect short code exhibits and command-line scenarios rather than long programs.
Exam objectives
Reading a stack trace to find the exception type, message, and originating file and line number
Distinguishing checked exceptions from unchecked RuntimeException subclasses and when each must be handled
Using try, catch, finally, throw, and throws correctly, including multi-catch and exception propagation
Compiling and running with javac and java, including the -d option that sets the output directory for class files
Assuming the topmost stack trace frame is the cause; the first 'at' line is where the exception was thrown, and lower frames show the callers.
Believing a method that declares throws FileNotFoundException and SQLException forces the caller to catch only one; the caller must handle or declare both.
Thinking finally never runs or that a return in try skips it; finally executes even when an exception propagates or a return occurs.
Click any question to see the full explanation and answer options, or start a focused practice session above.
Which of the following is the best practice for resource management in Java?
2A 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?
3Which statement about the Java compiler is true?
4Which command is used to run a Java application from the command line?
5Which TWO statements about the finally block are true? (Choose two.)
6Which THREE are checked exceptions in Java? (Choose three.)
7Given the stack trace above, which line in MyClass.java caused the exception? Exception in thread "main" java.lang.NullPointerException at MyClass.methodC(MyClass.java:25) at MyClass.methodB(MyClass.java:15) at MyClass.methodA(MyClass.java:10) at MyClass.main(MyClass.java:30)
8You 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?
9Arrange the steps to use a for loop to iterate over an array in Java in the correct order.
10Match each Java keyword to its use.
11Which of the following exceptions is a checked exception?
12A method declares throws FileNotFoundException and SQLException. Which statement about the caller is true?
13What is the output if an ArithmeticException occurs in the try block and there is a finally block?
14Which command compiles a Java file and generates a .class file?
15A custom exception class must extend which class to be a checked exception?
16When using try-with-resources, which interface must the resource implement?
17What does the java command with -jar option do?
18Given a method that catches Exception and then throws a RuntimeException, what is the effect?
19Which TWO are benefits of using try-with-resources?
20Which TWO are valid ways to handle a checked exception in a method?
21Which THREE statements are true about the Java logging API (java.util.logging)?
22Refer to the exhibit. A Java program throws a NullPointerException. Which is the most likely cause?
23Refer to the exhibit. A Java source file fails to compile with the given error. What change should be made to fix the error?
24A 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?
25A 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?
26A 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?
27A 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?
28Which tool is used to generate documentation comments from Java source code?
29A developer encounters a ClassNotFoundException at runtime. The class is present in the source code and compiles fine. Which is the most likely cause?
30Given the following try-catch block: try { // some code } catch (IOException | NumberFormatException e) { e = new IOException("wrapper"); // throw e; } Which line causes a compilation error?
31Which TWO statements are true about the finally block in exception handling? (Select exactly 2)
32Which TWO command-line tools are included in the Oracle JDK for monitoring and troubleshooting Java applications? (Select exactly 2)
33Which THREE statements about custom exceptions in Java are correct? (Select exactly 3)
34A 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?
35A 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?
36Consider the following code snippet: public int getValue() { try { return 1; } catch (Exception e) { return 2; } finally { return 3; } } What does the method return?
37A 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?
38A developer compiles a Java application using the command `javac -d bin src/com/example/App.java`. Which of the following is true?
39Which TWO of the following are best practices for exception handling in Java?
40Which TWO of the following development tools are specifically designed to analyze module dependencies or create custom runtime images?
41Which THREE of the following are checked exceptions in Java?
42You 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?
43A developer is debugging a Java application that throws a NullPointerException. Which two actions help identify the source of the exception? (Choose two.)
44Refer 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?
45A developer writes a method that parses a user-supplied string into an int using Integer.parseInt. The method must signal to its caller that parsing may fail with a NumberFormatException, but the developer wants callers to be forced to handle or declare it. Which change should the developer make to the method signature?
46A developer is writing a Java class that must open a network socket to a remote server. The code compiles successfully, but the developer is confused because the compiler requires the method to declare a throws clause or wrap the socket creation in a try-catch block. Which statement best explains why the compiler imposes this requirement?
47A developer writes the following code: public class Test { public static void main(String[] args) { try { throw new RuntimeException("A"); } catch (Exception e) { System.out.print("B"); } finally { System.out.print("C"); } } } What is printed?
48A developer is writing a Java application that must terminate immediately when a critical configuration error occurs, without printing a stack trace or allowing any finally blocks to execute. Which statement should the developer use?
49A developer wants to compile and run a Java program from the command line. The source file is named Hello.java and contains a single public class Hello. Which command correctly compiles the source file?
50A developer compiles a Java source file with the command `javac -d classes src/com/example/App.java`. The compilation succeeds. Where is the resulting `App.class` file placed?
51A developer writes a method that may throw a checked exception and wants to document the exception for callers. Which two statements about the `throws` clause are correct? (Choose two.)
52A developer is debugging a Java application and wants to pause execution at a specific line in a method without modifying the source code. Which Java Development Kit tool allows setting a breakpoint at a class and line number before launching the program?
53A developer is writing a method that catches multiple exception types in a single catch block using the multi-catch feature. The catch clause is: catch (IOException | SQLException e) { ... }. Which statement is true about the variable e in this catch block?
54A method declares `public void parse(String input) throws IOException`. Inside the method body, the code calls another method that declares `throws IOException` but does not throw it in every execution path. A reviewer asks the developer to document the method contract without changing behavior. Which statement best describes the effect of the `throws IOException` clause in the method signature?
55A developer runs a Java application and sees the message `Exception in thread "main" java.lang.ArithmeticException: / by zero` followed by a stack trace. Which statement best describes what happened?
56A developer uses the javadoc tool to generate documentation for a package. The source files contain Javadoc comments with the @param tag for a method parameter, but the generated HTML does not show the parameter description. The method signature is: public void calculate(int value). Which is the most likely cause?
57A developer is writing a utility method that opens a file, reads all lines, and returns the contents. The method should automatically close the file even if an exception occurs during reading. Which Java construct is specifically designed for this requirement?
58A developer is reviewing code that uses assertions. Which two statements about Java assertions are true? (Choose two.)
Deep-dive questions
The most-searched questions in this domain — detailed explanations, worked examples, full answer breakdowns.
You must read stack traces to pinpoint the throwing line, decide whether an exception is checked or unchecked, and know that callers of a method declaring checked exceptions must catch or re-declare them. The single most important skill is mapping a stack trace's first frame to the exact source line.
The Courseiva 1Z0-811 question bank contains 58 questions in the Exception Handling and Development Tools domain, covering the 14% of the exam attributed to this domain in the official Oracle blueprint. Click any question to see the full explanation and answer breakdown.
Start with a 10-question focused session to identify your baseline accuracy in this domain. Read every explanation — even for questions you answer correctly — to understand the reasoning. Once you score consistently above 80%, move to a 20–30 question session to confirm depth before moving to the next domain.
Yes — the session launcher on this page draws questions exclusively from the Exception Handling and Development Tools domain. Choose 10, 20, 30, or 50 questions for a focused session, or click individual questions to review them one by one.
Save your results, see per-domain analytics, and get readiness scores — free, for every certification.
Sign Up FreeFree forever · Every certification included