Marcelo Canaparro wrote:Unfortunatly accessing the documentation is not allowed. . .
Well, you will have to learn some of the commoner API members for the exam.
. . . it is safe to say the compiler can only check syntax and parameter type matching . . . Can I rely on that line on thought?
No. The
Java Language Specification (=JLS) gives lots of circumstances when compilation must fail. Most of those are incorrect syntax but some are logic errors, e.g. use of the keywords
static and
abstract together. Other compiler errors occur because you instructed the compiler to throw an error:-
There are probably spelling errors in that code, but there are
two three places where I have instructed the compiler to throw an error rather than run the code, and suffer a method which doesn't work or an exception. There is also code which will compile but issue a warning. I challenge you to get that code to compile and cause an exception to be thrown at runtime. I am old enough to remember when similar code would compile without warnings and errors would occur at runtime.
As you said earlier, you will get compile time errors if you use incorrect types or if you use correct datatypes whose definition in inaccessible, your code will fail to compile.
I think you should write lots and lost of different code and introduce potential errors into it and see what happens. You will lose marks if you say code won't compile if it throws an exception, or
vice versa.
[edit]Get my counting right
