
"A beginner-friendly breakdown of the two errors every developer faces"
What is a Compile-Time Exception? A compile-time exception (also called a checked exception or compile-time error) is an error that is detected by the compiler before the program even runs. The compiler reads your source code, checks it for mistakes, and refuses to build the program if it finds problems.Think of it like a spell-checker in Microsoft Word — it catches errors before you print the document. Common causes: Syntax errors (missing semicolons, brackets) Type mismatches (assigning a string to an integer variable) Calling a method that doesn't exist Missing imports or undefined variables Example in Java: int x = "hello" ; // ERROR: cannot assign String to int The compiler catches this instantly — the program never even runs. Key traits: Caught before execution. Easier to fix — the compiler tells you exactly where the problem is. The program cannot run until all compile-time errors are resolved. What is a Runtime Exception? A runtime exception is an error that occurs while the pr
Continue reading on Dev.to Beginners
Opens in a new tab


