Home
Examples
Labs
Assignment
Marks
Midterm
Final Exam
Resources

Things that Go Wrong

There are three different types of errors the can happen in computer programming :
  • Compile Errors - Compile errors usually happen when there is something wrong with the syntax or structure of your code.  Basically, the compiler didn't understand part of your program because you didn't follow the rules of the java language.  When the compiler does not understand part of your program it is not able to translate your source code into byte code.  You must fix all of the compile errors and have a sucessful compile before you can run your program.


  • Runtime Errors - Runtime errors are things that go wrong while your program is executing.  For example, incorrect input from the user, a missing data file, a division by zero, or using a String index that is out of bounds.  It is good programming practise to write code that anticipates and handles things that might go wrong during runtime.


  • Logic Errors - These are problems with your algorithm.  The steps that you developed to solve your programming problem were incorrect, or you described the steps to the computer incorrectly.  Basically, your program runs, but it does not behave the way that you expected it to.