Sometimes, there are functions which throw exceptions.
This is an example code of such a function:
public void someVoidThatThrowsException() throws IOException
// some code
To execute such a function, you will have to catch the exception.
The output will be: "Something has failed!" if something went wrong during the execution.
catch (Exception e)
System.err.println("Something has failed!");