This may sound awkward …
But I didn’t understand it.
Why do we have compile-time error and not compile-time exception in java ?
I mean to say that we never say compile-time exception.
We tend to say it as compile-time error.
Is there any specific reason for the same ??
Any suggestions are welcomed….
Thanks !
The reason for this is that an exception is something thrown during execution of a program. Java has a specific type for this, the
Exceptionclass.At compile time, your code is not executing, so it cannot throw an exception. Indeed, it is proper execution of the compiler to find errors in your code – certainly not an exception case!