Your current method covers the first point - to take an exception as parameter.
The throws Exception is unnecessary if you dont throw it from a method, but it is needed to cover the second point.

As commenters pointed, you just need to use the throw keyword to throw an exception, so the method could look like:

public void throwException (Exception ex) throws Exception {
    //some other code maybe?
    throw ex;
}

This implementation has a little flaw. When the null is passed as a parameter to it, the method will throw a NullPointerException, because the throw keyword accepts objects of the Throwable class or its subclasses (Exception is a subclass of Throwable).
To avoid NullPointerException (which is an unchecked-exception), simple if statement can be used:

public void throwException (Exception ex) throws Exception {
    if (ex != null) {
        throw ex;
    }
    //just for presentation,below it throws new Exception
    throw new Exception("ex parameter was null");
}

Edit:
As @Slaw suggested, in that very small case adding the null-check and throwing new Exception just disguises the NullPointerException. Without the null-check and throw new... the NPE will be thrown from that method and its stacktrace will show exact line of throw ex when the null is passed to that method.
The NPE is a subtype of RuntimeException class and the subtypes of RuntimeException doesn't need to be explicitly declared in method signature when they are thrown from that method. Like here:

public static void throwNPE(Exception e) {
    throw new NullPointerException();
}

The RuntimeException and its subclasses are called an unchecked-exceptions. Other classes extending one of Exception or Throwable classes are call checked-exceptions, because if a method throws them, it must declare that exception (or superclass) in the signature or explicitly try-catch it.

The proper use of null-check would be when the method would throw a more specific kind of exception (like IOException or a new subclass of Exception/Throwable) and the when the other method using the one which throws that new type of Exception would try-catch that specific type the NPE wouldn't be caught.

Just for good practices, when dealing with try-catch it's much better to catch exact types of thrown Exceptions instead of general Exception/Throwable. It helps to understand the real cause of exception, debug and fix code.

Answer from itwasntme on Stack Overflow
🌐
Programiz
programiz.com › java-programming › throw-throws
Java throw and throws Keyword
When we run this program, if the file test.txt does not exist, FileInputStream throws a FileNotFoundException which extends the IOException class. If a method does not handle exceptions, the type of exceptions that may occur within it must be specified in the throws clause so that methods further up in the call stack can handle them or specify them using throws keyword themselves.
🌐
Oracle
docs.oracle.com › javase › tutorial › essential › exceptions › throwing.html
How to Throw Exceptions (The Java™ Tutorials > Essential Java Classes > Exceptions)
These descendants indicate various types of exceptions that can occur. For example, IllegalAccessException signals that a particular method could not be found, and NegativeArraySizeException indicates that a program attempted to create an array with a negative size.
Discussions

How do you create a method to throw an exception in java? - Stack Overflow
My homework says we must follow these instructions to create the throwException method. throwException method Should take in an Exception object as its only parameter and return nothing Take that More on stackoverflow.com
🌐 stackoverflow.com
Should I throw an exception or return a boolean?

Throwing exceptions for "workflow" is generally a bad idea. I like seppyk's suggestion of separating into either multiple methods or renaming the purpose of the method.

There are some technical (that I can't explain well) reasons why using exceptions like this is a bad idea. Something to do with the JIT compiler reordering your bytecode for efficiency, but when the exception is thrown it's forced to figure out your method stack and it goes from being more efficient to less efficient because you're throwing exceptions in non-exceptional cases. Do some googling if you want a better explanation on that one.

Aside from the technical reasons why this is a bad idea, you're effectively using a GOTO statement in the form of an exception. I've done this before when adding to old code and I didn't have the luxury of being able to refactor everything, but it's a hack and should be treated as such.

More on reddit.com
🌐 r/java
30
28
September 25, 2011
Exception Handling Guide in Java
Devs are just too lazy to think about proper error handling. They just don't like the look of "verbose" throws and try-catches. There I called it. Checked exceptions are a nice instrument for situations where you have a recoverable business error and no result object to integrate the error into. Anyway, be it runtime exception or checked exception or result object or Either or Try, a business error must be part of the API. They are not an abstraction leak. Runtime exception is the only one of the mentioned above that can be - and often is - made invisible to the caller. More on reddit.com
🌐 r/java
45
30
January 24, 2021
Why does Java have Checked Exceptions
A couple recent conference talks might be relevant to this discussion. Elliotte Rusty Harold, Oracle Code New York 2019, Exceptions: I'm Telling You for the Last Time... https://www.youtube.com/watch?v=rJ-Ihh7RNao&list=PLPIzp-E1msrYxCCElyUPLzfmoXClUZuFL&index=27 2) Mike Duigou, Oracle Code One 2019, Exceptions 2020 https://events.rainfocus.com/widget/oracle/oow19/catalogcodeone19?search=DEV1262 (slide download only) Note: neither speaker thinks that checked exceptions were a mistake, though I suspect that both would admit that the situation could use improvement. In fact, Duigou's talk includes some suggestions for improving the situation. More on reddit.com
🌐 r/java
91
55
October 19, 2019
🌐
W3Schools
w3schools.com › java › ref_keyword_throws.asp
Java throws Keyword
close() delimiter() findInLine() ... Java Study Plan Java Interview Q&A Java Certificate ... Throw an exception if age is below 18 (print "Access denied")....
🌐
Rollbar
rollbar.com › home › how to throw exceptions in java
How to Throw Exceptions in Java | Rollbar
2 weeks ago - The example above will cause an ArithmeticException at the time of program execution, since a number can’t be divided by 0. It would throw an unhandled exception and the program would end. People often refer to "errors" and “exceptions” as the same thing colloquially. However, in Java these ...
🌐
DataCamp
datacamp.com › doc › java › throw
throw Keyword in Java: Usage & Examples
ExceptionType: The type of exception to be thrown (e.g., ArithmeticException, NullPointerException). "Error message": A string message providing details about the exception.
🌐
Medium
medium.com › @AlexanderObregon › java-exception-handling-throws-vs-try-catch-94b0abe1080d
Java Exception Handling — Throws vs. Try-Catch
March 17, 2024 - Exceptions are events that disrupt the normal flow of a program’s execution, and Java provides mechanisms to manage these disruptions gracefully. Two primary ways to handle exceptions are by using the try-catch blocks and declaring exceptions in method signatures with the throws keyword.
🌐
Pluralsight
pluralsight.com › blog › software development
How to throw an exception in Java | Online Courses, Learning Paths, and Certifications - Pluralsight
For example, let’s say that our `DivideByZeroException` extended from `Exception` instead of `ArithmeticException`: java public class DivideByZeroException extends Exception ... bash com/pluralsight/joshcummings/Divider.java:18: error: unreported exception DivideByZeroException; must be caught or declared to be thrown Double quotient = divide(numerator, denominator);
Find elsewhere
🌐
Medium
medium.com › javarevisited › how-to-throw-exceptions-in-java-using-throw-throws-keywords-throwing-exceptions-7082007f6462
How To Throw Exceptions In Java Using throw, throws Keywords | Throwing Exceptions | by Mouad Oumous | Javarevisited | Medium
February 22, 2024 - Just because this is not a compile time exception, meaning you do not need to handle it, that does not mean you don’t need to be concerned about it. In this example, we will throw an unchecked exception if the age is below 18:
Top answer
1 of 1
3

Your current method covers the first point - to take an exception as parameter.
The throws Exception is unnecessary if you dont throw it from a method, but it is needed to cover the second point.

As commenters pointed, you just need to use the throw keyword to throw an exception, so the method could look like:

public void throwException (Exception ex) throws Exception {
    //some other code maybe?
    throw ex;
}

This implementation has a little flaw. When the null is passed as a parameter to it, the method will throw a NullPointerException, because the throw keyword accepts objects of the Throwable class or its subclasses (Exception is a subclass of Throwable).
To avoid NullPointerException (which is an unchecked-exception), simple if statement can be used:

public void throwException (Exception ex) throws Exception {
    if (ex != null) {
        throw ex;
    }
    //just for presentation,below it throws new Exception
    throw new Exception("ex parameter was null");
}

Edit:
As @Slaw suggested, in that very small case adding the null-check and throwing new Exception just disguises the NullPointerException. Without the null-check and throw new... the NPE will be thrown from that method and its stacktrace will show exact line of throw ex when the null is passed to that method.
The NPE is a subtype of RuntimeException class and the subtypes of RuntimeException doesn't need to be explicitly declared in method signature when they are thrown from that method. Like here:

public static void throwNPE(Exception e) {
    throw new NullPointerException();
}

The RuntimeException and its subclasses are called an unchecked-exceptions. Other classes extending one of Exception or Throwable classes are call checked-exceptions, because if a method throws them, it must declare that exception (or superclass) in the signature or explicitly try-catch it.

The proper use of null-check would be when the method would throw a more specific kind of exception (like IOException or a new subclass of Exception/Throwable) and the when the other method using the one which throws that new type of Exception would try-catch that specific type the NPE wouldn't be caught.

Just for good practices, when dealing with try-catch it's much better to catch exact types of thrown Exceptions instead of general Exception/Throwable. It helps to understand the real cause of exception, debug and fix code.

🌐
DataCamp
datacamp.com › doc › java › throws
throws Keyword in Java: Usage & Examples
Here, the processFile method declares that it can throw both IOException and FileNotFoundException. This informs the caller that the method may encounter either of these exceptions.
🌐
Sentry
sentry.io › sentry answers › java › how to throw exceptions in java
How to Throw Exceptions in Java | Sentry
October 21, 2022 - In Java, you might want to explicitly throw an exception when you know your program has reached some state that would prevent it from continuing to execute successfully. To throw an exception, we need to specify the keyword throws along with the exception type and any additional arguments the relevant exception constructor will accept. For example, to throw a generic exception we can use the Exception class as shown below:
🌐
CodeGym
codegym.cc › java blog › java exceptions › java throw exception
Java throw Exception
May 2, 2023 - public class DivisionExample { ... a, int b) { return a / b; } } In this example, an ArithmeticException is going to be thrown because the variable b is zero....
🌐
Tutorialspoint
tutorialspoint.com › java › java_throw_exception.htm
Java - Throws and Throw | Throw an Exception
A method can declare that it throws more than one exception, in which case the exceptions are declared in a list separated by commas. For example, the following method declares that it throws a RemoteException and an InsufficientFundsException − · import java.io.*; public class className { public void withdraw(double amount) throws RemoteException, InsufficientFundsException { // Method implementation } // Remainder of class definition }
🌐
FavTutor
favtutor.com › blogs › java-throw-exception
How to Throw an Exception in Java (with Examples)
December 26, 2022 - Here, the exception i.e, Instance must be of type Throwable or a subclass of Throwable. For example:
🌐
JetBrains
blog.jetbrains.com › idea › 2024 › 03 › easy-hacks-how-to-throw-java-exceptions
Easy Hacks: How to Throw Java Exceptions | The IntelliJ IDEA Blog
March 12, 2024 - IndexOutOfBoundsException is such an exception type, which may be thrown when you try to access an index in an array or string that is out of range. Another example is NullPointerException, which may be thrown when a variable that is not pointing ...
🌐
Oracle
docs.oracle.com › javase › tutorial › essential › exceptions › declaring.html
Specifying the Exceptions Thrown by a Method (The Java™ Tutorials > Essential Java Classes > Exceptions)
For example, if you were providing the ListOfNumbers class as part of a package of classes, you probably couldn't anticipate the needs of all the users of your package. In this case, it's better to not catch the exception and to allow a method further up the call stack to handle it. If the writeList method doesn't catch the checked exceptions that can occur within it, the writeList method must specify that it can throw ...
🌐
GeeksforGeeks
geeksforgeeks.org › java › throw-throws-java
throw and throws in Java - GeeksforGeeks
Explanation: The above example demonstrates an exception using throw, where an ArithmeticException is explicitly thrown due to division by zero. throws is a keyword in Java that is used in the signature of a method to indicate that this method might throw one of the listed type exceptions.
Published   August 5, 2025
🌐
Habr
habr.com › en › articles › 771890
How to Use Throw and Throws in Java / Habr
November 4, 2023 - We can use the throws keyword for exception handling without using a try-catch block. Q3: Why we use throws instead of try catch? Ans. We can use the throws keyword to declare the exception with the method declaration. It is used to forcibly throw the exception, while the try-catch block handles the exceptions thrown by the code in Java.
🌐
JA-VA Code
java-performance.info › home › mastering the art of throwing exceptions in java: a guide
Throw Exception Java: Best Practices
September 25, 2023 - You can catch multiple exceptions ... the exception types. For example: try { // Code that may throw exceptions } catch (IOException | SQLException e) { // Handle IOException or SQLException }...
🌐
Mastering Backend
masteringbackend.com › hubs › java-backend-development › exception-handling-in-java-throw-and-throws
Exception Handling in java (throw & throws)
May 24, 2025 - returnType methodName(parameters) throws ExceptionType1, ExceptionType2 { // method body } public void readFile() throws IOException { // code that might throw IOException } public void processFile() throws IOException, ParseException { // code that might throw either IOException or ParseException } import java.io.IOException; public class MasteringBackend { // Method that declares it might throw an IOException public static void readFile(String fileName) throws IOException { if (fileName == null || fileName.isEmpty()) { // Throwing a checked exception throw new IOException("File name cannot b