I have been wondering about something lately.It is about the errors which an IDE like netbeans show us while we type the code(Let’s assume java).I want to know whether an IDE is capable of identifying all the compile time errors while we type? It means if we run the code with an IDE, are we supposed to get only the run time errors?
Share
It depends on the IDE. For example, in Eclipse, if there are any compile-time errors when you try to run the code, it will warn you about this, but still allow you to continue if you want to. At that point, any code which successfully compiled will execute as normal – but any methods or classes which couldn’t be compiled will have the failure represented as an exception thrown by the generated code. Exactly where the exception is thrown depends on the kind of compilation failure.
In general, most of the time you should be running code which compiles without any errors. While the ability of Eclipse to “fake it” is occasionally handy, it would be a bad idea to get into the habit of using it instead of fixing up errors as you go, in my view.
EDIT: If the question is “Will I always know if there are any compile-time errors” then yes, assuming you don’t blindly dismiss the warning that Eclipse gives you. I don’t know of any IDE which will silently let you run code with compile-time errors in. (You should also look at the Errors view, or whatever your IDE happens to provide, of course.)