Monday, June 15, 2009

Errors

What has been indicated so far is a Java program where we did not find various problems in the process of compiling and running it at the time. However, this does not always happen. As we discussed in the The first part of this exercise, we will also usually find the problems
during the process.
As discussed previously, there are 2 kinds of error. First is compile-time error, or also called as a syntax error. Second is the runtime errors.

Syntax Errors

Syntax errors usually occur because of errors. You may lack a command in Java or forget to write the dot-coma at the end of the statement. Java attempts to isolate the error shows how
lines of code and the first one refers to the characters in the bar.
However, error will not necessarily be at the designated point. Other common error is in the capitalization, spelling, the use of characters special that is not correct, and omission of the punctuation actually.
Let us take an example, the program Hello.java, where we deliberately the point-comma at the end of the statement and also try to type in spelling is wrong on an order.



See error message that is displayed after the Peng-compile-run a program. The first error message that tells you there is a program in error in line 6. This is the word refer to the after statict, which should be spelled as static.
The second error message that tells the program to lose titikkoma after your statement.



If you find an error message, try to edit a mistake The first error in the list one by one, and try to mengkompilasinya you are welcome. By doing so then, can reduce the total error.

Run-time Errors

Run-time error is an error which will not be displayed until you run your program. Even programs that compile successfully may display the wrong answers if the programmer has not thought through the logical structure and from the program.

No comments:

Post a Comment