Throws is the signature of the method body, which means it can only be used after the method, such as main () throwsservletException. IoException means that this method will throw an exception IOException. As for the specific exception, we don't have to worry, the JVM will handle it. For example, if you use some methods of the File class, it will report an error if you don't throw an exception to the method declaration. There are two ways to handle this error, one is to write a try{}cathc{} method block in the method body for judgment, and the other is to directly declare throwing an exception after the method body and hand it over to java for processing.
And throw is to throw a specific exception instance and write it in the method body. Such as throwing a new exception () and so on.