what is the diff b/w error and exceptions
Answers were Sorted based on User's Feedback
Answer / sivakumar kasa
In any programming language there can be three kinds of errors.
1. "Syntax Errors":
The mistakes done while writing statements. For
example, instead of "WRITE", if you type "WIRTE" it is a
syntax error.Compiler can detect these types of errors. You
will not able to be run the program till these errors are
rectified.
2. "Runtime Errors (Exceptions)":
Runtime Errors are thrown when the situation occurs
during execution of program where the system will not
know how to deal with such situation. For example, you have
written a program that takes an excel file and reads the
data and stores in the database. You have done the program
perfectly. No syntax errors.But while executing the
program, if the user enters a filename that does not exist,
the program will not know what to do next, at that time
runtime error occurs. Runtime error terminates the
execution of the program abruptly. Runtime errors mostly
occur due to incorrect user entries or improper usage of
system resources by program. These runtime errors can be
avoided if we catch the exceptions. You can handle every
possible exception and throw user defined messages during
the execution and avoid abrupt termination of the program.
3. " Logical Errors":
Logical errors are obviously the mistake done in the
logic by programmer. For example, Value = Rate - Discount
is the normal universal calculation. By mistake if you have
typed Value = Rate + Discount, it is neither syntax error
nor runtime error. Your program is successful but result is
wrong.
NOTE: This can be corrected only through thorough
study of the program or worst case debugging.
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / jayati saha
I don't know the exact answer but I think error refers to
the bug which may be detected at run time or not ,may
produce an exceptional result or not.
i mean to say that it may be a syntax error, logical error
which may produce abstract result or not but exception are
the errors which are detected at run time .
so we can say that exception are nothing but runtime error,
if exception occurs then a program will be terminated
abnormally and immediately.
so we have to design exception handler, a block of code
which can catch the error and thus can prevent the abnormal
termination of the program.
Thanks and hope for the better answer.
Is This Answer Correct ? | 3 Yes | 2 No |
Answer / sirisha
Error is the one which can not be guessed or controlled.
Errors occur during the run time. Once the error occurs, the
program will be terminated automatically.
Exceptions are the ones which can be expected before hand
and can be handled in the program. Hence, even the exception
occurs, it will be handled, and the process will be
continued without any termination.
Is This Answer Correct ? | 2 Yes | 1 No |
I a custom table some one has edited and deleted something, So how we should maintain the log for changed and edited datas
What is a badi?
How to convert Normal function module to RFC enabled Function Module?
How the at-user command serves mainly in lists?
Hi All, I have a scenario in Script. I want to display the data both side in a page. How can get it?
in mm and sd,in which table plant and storage location are there?
Why are insert and append statement used in sap abap?
How will you do in session method?
3 Answers FutureSoft, Unilogic Software,
Structures can contain data only during the runtime of a program (t/f) : abap data dictionary
How do you delete duplicate records from internal table?
What will happen when we use single buffered selected?
Difference between interactive and ALV Reports