Exception handling (try / catch)
 
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.
try
    {
    someVoidThatThrowsException();
    }
catch (Exception e)
    {
    System.err.println("Something has failed!");
    }
 
admin / Dec 05, 2004
   
 
 
Login: 
Pass: 
 
 
     
     
2004 - 2019 / lookass.ch
makememad@lookass.ch