Quote:
Originally Posted by HelloWorld Would the compiler return some kind of an exception if we don't put int return value in the main method? |
Well, it depends on which compiler you are using. If you want to know for sure for any given compiler, do it and see what happens. Some will refuse to compile, some will give you a warning but compile anyway, some will compile without mentioning that you've coded against the standard. Needless to say, a compiler that doesn't tell you when you're making mistakes and compiles around it is not something to wish for.
An 'exception' occurs during run-time. Your compiler will give you errors or warnings.