There is a reason. This allows you to run applications with compilation errors (like!). What the compiler does is create stub methods for any methods that it cannot compile due to errors in the source code. If an application calls one of these stub methods, you get a run-time exception that says the method had a compilation error.
IMO, this “feature” is mostly harmful ... and it can be very confusing for newcomers to Eclipse. However, it may be useful for people who want to perform runtests, etc. In partially written classes.
IIRC, in the Run dialog box there is a checkbox that allows you to enable / disable running applications with compilation errors. (I always turned it off!)
UPDATE
This behavior is specific to Eclipse. It is controlled by the parameter in the settings panel "Window> Preferences> Run / Debug> Run".
source share