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 |
Where are the LSMW events :BEGIN_OF_PROCESSING, BEGIN_OF_TRANSACTION and BEGIN_OF_RECORD declared? Why?
1 Answers Cap Gemini, Deloitte,
What are the events used for logical database?
How to handle Errors in Function Modules?
Explain what are the events used in interactive reports?
What are two methods of modifying sap standard tables?
What are the advantages/ dis-advantages of logical databases?
what is basic difference between BDC&dialogprogramming? what is basic difference between reports&dialogprogramming?
What are the functions of lock objects?
how to debug dialog box?
In ALV reporting when u execute your report which event gets triggered.
What is the difference between data elements and domains? : abap data dictionary
What does nw 7.4 sp 05/nw 7.5 sp 02 offers in abap?