Compile-Time vs Run-Time Exceptions in Java

java dev.to

What is a Compile-Time Exception? A compile-time exception (also called a checked exception) is an error that occurs before the program runs, during compilation. The Java compiler checks these errors and forces the programmer to handle them using try-catch or the throws keyword. If not handled, the program will not compile. Examples: --> IOException --> FileNotFoundException --> ClassNotFoundException import java.io.*; publi

Read Full Tutorial open_in_new
arrow_back Back to Tutorials