answersLogoWhite

0


Best Answer

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
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

Run-time errors

This answer is:
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.

Related questions

A CPU executes only?

A CPU does math and accesses memory.


What is run time in java?

That refers to anything that happens while you run the program. For example, the compiler may detect certain problems while you compile the program, but certain errors are bound to happen only when you actually run the program - i.e., at runtime.


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.


What is a good sentence with the word caught in it?

Johnny not only caught the baseball his friend tossed to him, he also caught the flu.


What is error estimation?

Error estimation involves figuring out the number of errors in a program. This calculation is used not only for computers but also for some equations in math like linear equations.


What is the difference between interrupt and system call?

A processor executes its instructions one after another. One of the instructions it can execute is a subroutine call, where it suspends executing the current set of instructions, goes off and executes another set and then returns. This is referred to as 'calling a subroutine.' A 'system call' is a call to a subroutine built into the system, rather than a call to one in your own program. Calls and interrupts work similarly, in that to process an interrupt, the processor goes off and executes a different set of instructions and returns. However, calls are synchronous, they occur in fixed order determined by the program, and the processor only has to remember where it was so it can return to the proper place. Interrupts are asynchronous, they can occur at any time, such as when you hit a key on the keyboard, thus the processor has to remember its place and its state, because the interrupt likely has nothing to do with what it was doing at the time of the interrupt.Disturbing other


How do you get finally block in javascript to only execute if there are no errors are caught by catch block?

You might consider a construct like this: try { some code } catch (exception) { var err=1; } if (!err) { your finally block }


Is homicide's hinder employment?

Only if you get caught.


Can you have a if statement where both the if and else part are executed?

No. An if statement executes its target block if the condition is true, and executes its else block if the condition is false. There is no ambiguity. Even if the terms of the condition changed during the execution of the target block, it would not matter because the condition is evaluated only once, at the beginning of the processing of the if statement.


What is the difference between a compilation error and logic error?

errors which come during compilation is known as compilation error. here we get syntax errors only not logical errors like division by zero. logical error occur during run time example:if you write a program for division with zero you will not get compilation error but during execution you will error


Do you go to jail if you break in house?

Only if you are caught.