Do you know Java?
I am jealous of Emmanuel (Manu) Stapf who blogged about this before I had the time to; but I can at least refer you to his entry [1].
The idea actually comes from Martin Nordio, who as part of his thesis work formalized the exception semantics of both Eiffel and Java. In the process he came across some (shall we say) interesting properties of Java, and got into the habit of asking people first if they know Java well, and then if they can predict the results of some simple programs.
So, do you think you know Java? If so, please take the test, and wait for the answer next week in Manu’s blog.
Reference
[1] Emmanuel Stapf: “And people are still using Java?” blog entry.
I tried to post this comment on the referenced page, but the system would neither let me create a new account nor mail me my (supposedly existing) account infos, so i’ll post it here:
As for question number 4: Note that – in contrast to java – C# does not allow a control statement inside a finally clause that jumps out of the block. Therefore, this would result in a compile error.
Indeed. (But this leaves open the question of what the result is in Java.)
I have no idea why you couldn’t create an account on EiffelRoom.
No developer in the sane mind would put ‘return’ or ‘break’ into ‘finally’ section, does not matter if the language allows this or not. Likely good style can also be used also if the language does not enforce it so I expect to apply Eiffel knowledge in Java and C as well.