Compile time vs Run-time error

By YuwebDesign

Compile time error vs Run-time error

Compile time error

Compile time error is any type of error that prevents a java program from compiling, e.g.,

  1. syntax error
  2. class not found
  3. a bad file name for the defined class
  4. a possible loss of precision when you are mixing different java data types

Compiling errors are good, because they allow us to fix our code.

Run-time error

Run-time error happens, while the program is running.

Run-time errors are bad because they crash our program and we don’t always catch them before it is too late.

Leave a Reply or Comment

Your email address will not be published. Required fields are marked *