I was reading the Exception Handling in Java and was facing problem to understand the below exception method.
public static Object deserialize() throws IOException,
ClassNotFoundException {}
another
try {
} catch (ClassNotFoundException | IOException e) {
e.printStackTrace();
}
I Know how try and catch works. But I don't know how throws IOException,ClassNotFoundException
in my First example.
What is the Difference? and which should I choose?
I know it could be stupid question, because I don't know how I can search on Google for this.