Published on June 16, 2022
Compile-time errors are errors that happen when we use the incorrect syntax or semantics of any programming language. The compiler will then throw compile-time errors at us. Until all of the program’s errors are fixed, the compiler won’t allow it to execute.
Characteristics of Compile-Time Exceptions:
Example of Compile-time error
In the above code, we have tried to print the value of ‘a’, but it throws an error. We put the colon at the end of the statement instead of a semicolon, so this code generates a compile-time error.
The Errors that happen during execution and after compilation are known as runtime errors. Runtime mistakes include, but are not limited to, division by zero. Since the compiler does not flag these problems, they are difficult to find.
Characteristics of Runtime Exceptions:
Example of runtime error
In the above code, we try to divide the value of ‘b’ by zero, and this throws a runtime error.
Compile-time and Runtime are the two programming terms used in software development. Compile-time is the time at which the source code is converted into an executable code while the run time is the time at which the executable code is started running. Both the compile-time and runtime refer to different types of error.
The views expressed in this document are those of the author and do not necessarily reflect the position of the London School of Emerging Technology. View the detailed policy Disclaimer for Student and Personal Websites