Types of Errors: School of Computer Science & Information Technology
Types of Errors: School of Computer Science & Information Technology
Types of Errors
Information Technology
Syntax errors
Mistakes in the rules of the language itself
Illegal Java - errors of grammar or punctuation
G6DICP - Lecture 6
Semantic errors
Mistakes in the logic of the code
Errors, bugs and debugging Legal Java - but not what you intend!
11 12
Causes of Runtime Errors Exceptions
Errors that only become apparent during the course of When a potential error condition occurs while a
execution of the program program is running an Exception occurs
External Factors - e.g. For example attempting to read from a non-existent
Out of memory file
Hard disk full Exceptions are of specific types - e.g.
Insufficient i/o privileges ArithmeticException
etc.
IOException
Internal Factors - e.g. ArrayIndexOutOfBoundsException
Arithmetic errors
Attempts to read beyond the end of a file
If the program contains code to handle the
Attempt to open a non-existent file
exception that code is triggered.
Attempts to read beyond the end of an array If there is no code to handle the exception then
13
etc.
14
the program terminates with a runtime error
15 16