Almost every method would have to declare throwing it.

public void myMethod(String param) throws NullPointerException {
   //
}

(As a sidenote - Eclipse for example gives you a warning whenever there is a "potential null pointer access" so that you can prevent the exception as early as possible.)

Answer from Bozho on Stack Overflow
🌐
Quora
quora.com › Is-NullPointerException-checked-or-unchecked
Is NullPointerException checked or unchecked? - Quora
Answer: It's not a checked exception (among other things) because it is extremely common. It can occur pretty much everywhere. If it were checked, then nearly every single method in every single Java program anywhere would have to declare that ...
🌐
Coderanch
coderanch.com › t › 615939 › java › null-pointer-exception-type-exception
Is null pointer exception the only type of exception we are not supposed to catch? (Java in General forum at Coderanch)
The page The Catch or Specify Requirement in Oracle's tutorial about exceptions explains about the three kinds of exceptions and what you are or are not supposed to catch. In general, you're required to handle checked exceptions, and you're not supposed the catch unchecked exceptions and errors. ...
🌐
Oracle
docs.oracle.com › javase › tutorial › essential › exceptions › runtime.html
Unchecked Exceptions — The Controversy (The Java™ Tutorials > Essential Java Classes > Exceptions)
One case where it is common practice to throw a RuntimeException is when the user calls a method incorrectly. For example, a method can check if one of its arguments is incorrectly null. If an argument is null, the method might throw a NullPointerException, which is an unchecked exception.
🌐
Baeldung
baeldung.com › home › java › checked and unchecked exceptions in java
Checked and Unchecked Exceptions in Java | Baeldung
January 8, 2024 - Java does not verify unchecked exceptions at compile-time. Furthermore, we don’t have to declare unchecked exceptions in a method with the throws keyword.
🌐
How to do in Java
howtodoinjava.com › home › exception handling › java nullpointerexception
Handling Java NullPointerException and Best Practices
October 1, 2022 - Java NullPointerException is an unchecked exception and extends RuntimeException. Learn why NullPointerException occur and how to handle it in the code.
🌐
TheServerSide
theserverside.com › answer › What-are-checked-vs-unchecked-exceptions-in-Java
What are checked vs. unchecked exceptions in Java? | TheServerSide
This is an unchecked exception caused by poor programming practices that are not revealed until the program executes. Therefore, it requires no exception handling semantics. The technical description of checked vs. unchecked exceptions provided ...
🌐
Reddit
reddit.com › r/learnprogramming › ioexception vs nullpointerexception
r/learnprogramming on Reddit: IOException vs NullPointerException
December 15, 2021 - Java has checked exceptions and unchecked exceptions. Checked exceptions extend Exception. Unchecked exceptions extend RuntimeException or Error. Checked exceptions must be caught or declared to be thrown by the method. It forces you to handle or at least acknowledge the exception can occur. Unchecked exceptions do not have this constraint. IOException, InvalidAccessException, etc are checked. NullPointerException, ArrayOutOfBoundsException and friends, IllegalArgumentException, AssertionError, ThreadDeath (error), etc are all unchecked...
🌐
Coderanch
coderanch.com › t › 572911 › java › Confusion-checked-unchecked-exceptions-java
Confusion between checked and unchecked exceptions in java (Beginning Java forum at Coderanch)
And there is no pre-mature death(execution termination) of program for checked exceptions? ... Hello, Runtime Exceptions are called as Unchecked Exceptions. Error and its subclasses also throw Unchecked Exceptions. NullPointerException is an unchecked Runtime Exception.
Find elsewhere
🌐
Wikibooks
en.wikibooks.org › wiki › Java_Programming › Preventing_NullPointerException
Preventing NullPointerException - Wikibooks, open books for an open world
A NullPointerException is actually better, as it allows the runtime to tell you about the bug, rather than just continue with a default value. ... An array created using new Object[10] has 10 null pointers. That's 10 more than we want, so use collections instead, or explicitly fill the array ...
🌐
Rollbar
rollbar.com › home › how to handle checked & unchecked exceptions in java
How to Handle Checked & Unchecked Exceptions in Java | Rollbar
July 5, 2024 - An unchecked exception (also known as an runtime exception) in Java is something that has gone wrong with the program and is unrecoverable. Just because this is not a compile time exception, meaning you do not need to handle it, that does not ...
🌐
Javapractices
javapractices.com › topic › TopicAction.do
Java Practices->Checked versus unchecked exceptions
a method is obliged to establish a policy for all checked exceptions thrown by its implementation (either pass the checked exception further up the stack, or handle it somehow) It's somewhat confusing, but note as well that RuntimeException (unchecked) is itself a subclass of Exception (checked).
🌐
Software Testing Help
softwaretestinghelp.com › home › java › what is nullpointerexception in java & how to avoid it
What Is NullPointerException In Java & How To Avoid It
April 1, 2025 - The exception java.lang.NullPointerException is an unchecked exception and extends the RuntimeException class. Hence there is no compulsion for the programmer to catch it. In this tutorial, we have discussed the NullPointerException in Java.
🌐
Rollbar
rollbar.com › home › how to catch and fix nullpointerexception in java
NullPointerException Crash Your Java App? Here's How to Fix It
1 week ago - This check avoids the NullPointerException since the length() method of the string is called only if it is not null or empty. Otherwise, the message Empty string is printed to the console. NullPointerExceptions are among the most common runtime errors in production Java applications.
🌐
How to do in Java
howtodoinjava.com › home › exception handling › java checked vs unchecked exceptions
Java - Checked vs Unchecked Exceptions (with Examples)
December 20, 2022 - The strange thing is that RuntimeException is itself subclass of Exception i.e. all unchecked exception classes should have been checked exceptions implicitly, BUT they are not.” · The code in the given program does not give any compile-time ...
🌐
Medium
medium.com › @AlexanderObregon › the-difference-between-checked-and-unchecked-exceptions-in-java-for-beginners-c3943786c40a
The Difference between Checked and Unchecked Exceptions in Java for Beginners
January 15, 2024 - Dealing with Unchecked Exceptions: Focuses more on preventive programming practices to avoid the occurrence of these exceptions rather than handling them. Checked Exceptions: IOException, SQLException, ClassNotFoundException.
🌐
Coding Shuttle
codingshuttle.com › java-programming-handbook › checked-and-unchecked-exceptions
Checked vs Unchecked Exceptions in Java: Ultimate Guide | Coding Shuttle
July 24, 2025 - Unchecked Exceptions – Exceptions that occur at runtime and do not require mandatory handling. ... Checked exceptions are exceptions that must be handled using a try-catch block or declared using throws in the method signature.
🌐
Spark Code Hub
sparkcodehub.com › java › checked-and-unchecked-exceptions
Mastering Checked and Unchecked Exceptions in Java: A Comprehensive ...
For example, when opening a file, ... often result from unforeseen programming errors. For instance, a · NullPointerException indicates a bug that should be fixed rather than handled....
🌐
Pedrolopesdev
pedrolopesdev.com › java-checked-vs-unchecked-exceptions
Checked vs. Unchecked Exceptions in Java | Pedro Lopes
Unchecked exceptions are something that should not happen but somehow happened. We should only use instances of RuntimeException in those cases. For example, NullPointerException is an unexpected error that sometimes appears due to the application's current state...
🌐
SEI CERT
wiki.sei.cmu.edu › confluence › display › java › ERR08-J.+Do+not+catch+NullPointerException+or+any+of+its+ancestors
ERR08-J. Do not catch NullPointerException or any of its ancestors - SEI CERT Oracle Coding Standard for Java - Confluence
This noncompliant code example defines an isName() method that takes a String argument and returns true if the given string is a valid name. A valid name is defined as two capitalized words separated by one or more spaces. Rather than checking to see whether the given string is null, the method catches NullPointerException and returns false.