News:

MyKidsDiary.in :: Capture your kids magical moment and create your Online Private Diary for your kids

Main Menu

Types of Errors in Java

Started by karthikn, Jul 18, 2008, 08:15 PM

Previous topic - Next topic

karthikn

There are several types of error, each with its own method of detection and repair. The basic types of error are:

    * Syntax errors are errors in grammar and punctuation such as mismatched quotes, missed commas or case-sensitivity issues. These errors are caught by the javac compiler.
    * Runtime errors only show up as the program is executed. A common example is division by zero. These can be caught by static testing.
    * Logic errors are basic errors in the programmer's algorithms or procedural errors. Diagnosis only comes when incorrect results occur and solution requires mapping out the flow for test cases. An example is wrong scoping of a variable. Dynamic testing is required.
    * Incorrect operator precedence errors are basic mathematical grouping errors. The best way to avoid them is with brackets to force the grouping explicitly. Static testing will show some types of problem. Dynamic testing will catch others.
    * Threading errors can occur when multiple threads are programmed. Common issues are access, deadlock, data race and synchonization. These types of errors are very difficult to trace.

One type of compiler warning message that should be corrected A.S.A.P. is a deprecation warning. This occurs when an out of date method is used. Find out what the new technique is and replace older code with it. You may want to check your source libraries for other programs with the same construct.