Logic errors occur at run time and are caused by problems in the developers logic. Some people may consider these "runtime errors" as they happen as the program is running. This is not the case. Runtime errors are very different and tend to be the result of external factors rather than the developers logic.

A runtime error can be defined as a unexpected exception in the running of the system caused by external, uncontrollable factors. Let us conceptualize this with an example. Consider internet explorer. When it connects to the internet it needs the following to be in place

These can not be controlled by internet explorer and may not be available. The network cable may of been unplugged or the hardware unplugged. The ISP may be down or cut off. You may have too many programs open. The list of things which could go wrong is endless. It is impossible of IE to recover from these errors. As such we call the runtime errors or exceptions

When a runtime error occurs the program should report the error in a meaningful way to the user. Hanging or giving a critical error is not good enough as the user may be able to fix the problem. For example if you tell the user "no network connection" they would most likely look to see if the network cable was plugged in. If you said "no internet connection" they may give their ISP a quick ring to see if there was a problem.

Runtime errors will not crash the computer and are known as recoverable errors. This means that although that operation may of failed the rest of the system can continue. The more runtime errors the program can handle the more robust it will be.

In Java runtime errors are called exceptions. You would trap a exception with a try / catch block. For example see what the code below produces..

try{
    String value = null;
    int len = value.length();
    System.out.println(len);
} catch(Exception e){
    System.out.println("ERROR - got a " + e.toString() + " error");
}