answersLogoWhite

0

The only thing that can actually be "caught" at runtime is an exception. An exception is not a run-time error as such; it only becomes a runtime error if it is not caught in which case it becomes an unhandled exception. An exception is handled the moment it is caught, and therefore isn't an error. Depending on the nature of the exception, there may be no need to alert the user that an exception has even occurred.

Runtime errors include logic errors and system errors. Logic errors are bugs that can be identified at runtime. System errors are a bit more problematic because system errors do not throw exceptions so we cannot catch them. However, many can be resolved at runtime before they become system errors. Divide by zero is an example; always check your divisors are non-zero before executing any division operation. Hardware malfunction's, on the other hand, are often beyond our control, but they are not really run time errors unless they occurred because of our code rather than in spite of our code.

User Avatar

Wiki User

8y ago

Still curious? Ask our experts.

Chat with our AI personalities

RafaRafa
There's no fun in playing it safe. Why not try something a little unhinged?
Chat with Rafa
ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi
FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
More answers

Run-time errors

User Avatar

Wiki User

12y ago
User Avatar

Add your answer:

Earn +20 pts
Q: What errors are caught only when a program executes?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What statement executes a group of statements only if a certain condition is true?

The if statement.


What are the programs that are executing during compilation in c?

The only program that executes during compilation is the compiler. The compiler produces one object file for each translation unit compiled. When all translation units are compiled, the object files can then be linked together by executing the linker.


What is used to translate source code instructions into appropriate machine language instructions?

Languages are either "Compiled languages" or "interpreted languages": - A compiled language will use a compiler which is another program that checks your code and then converts it to the correct machine code for the machine it is intended to run on. You can only run the program after you have compiled it. A compiler can help spot syntax errors and certain semantic errors and will give you a "compilation error". - An Interpreted language can be ran directly as long as you have another program called the interpreter which translates your code into machine code whilst it is running. This means certain errors will not be caught before runtime (There is no concept of a compilation error) and so you won't know until runtime if certain errors are present in your code


How do you solve fatal error in c program?

Fatal errors are errors or exceptions that cause a program to abort. You solve fatal errors by examining the source code to determine what is causing the error. If the error is an exception, it can be caught. That is precisely why we always place a catch-all exception handler in the main function. Once we know where the exception was raised we can write code to specifically deal with that exception -- at or near the point it was actually raised. However, not all fatal errors throw exceptions. For example, a divide by zero operation is a fatal error because your program has allowed the system to attempt an illegal operation for which there is no reasonable means of recovery. The only solution is to avoid invoking illegal operations; test your assumptions and always assert that all operands are within the acceptable range of the operator. Fatal errors can also be caused by hardware failure, such as bad RAM, which is beyond the remit of applications programmers.


Where does java system setProperty store the data?

This seems to be both platform- and implementation-dependent. In some cases, properties may only be stored in memory, and will lose their value once the JVM exits. In other cases, properties may be written to disk and restored each time your program executes.