>>122
The concept of "contract" comes from OOP. What I'm talking about extends to your non OOP languages.
It is used with that meaning in some OO languages, but what I was talking about is more general, for example, in more low-level languages like C or assembly, you could imagine a header file that states that some linked list or array is to be treated as unordered by all code and anyone depending on the ordering is doing so at his own risk (because other functions that operate with it may change it in ways which are not specified in this "contract"). In the context of programming, it's merely what a programmer promises about the behavior of the code he's written and what the intended usage is - the language is irrelevant.
I'm not entirely sure what the argument in the rest of the post is about, the java code you posted can be optimized away (to nothing) as the code does not change any state, nor does it return any values.
Again, you seem to be forgetting that this whole conversation was only tangentially related to programming and that some particular implementation of some concept isn't the same thing as the concept.
To better explain this, consider 2 examples:
1) Some programmer defined a file format or a network protocol and implemented it, the implementation is proprietary and closed-source, but some parts of the format(s) are freely available for all to see. His implementation is
mostly correct, but in some cases, he made some mistakes which lead to his programs behaving a bit differently than he promised they would in the documentation - this isn't yet known to either him or the audience (such as the users of the programs). I notice some peculiarities in the way the program constructs the data (which is supposed to fit the official document), I then proceed to disassemble his closed-source software and I'm not aware of all kinds of implementation details that not even the author was aware of. I can now write a document describing exactly what the program does, not what the programmer intended for the program to do. I can also point out how the "is" differs from the "should" in this particular case. A lot of programming bugs happen when one confuses the should with the is. There's many deeper questions about should vs is, outside the programming-related meaning I just explained, but I'll stop because it would be widely off-topic.
2)Numbers define progressions. In some interpretation I could use sticks to talk about natural numbers, in another I could use a Turing Machine to encode them, in another I could use C, Lisp, Java, whatever works. In a less usual interpretation I could even consider non-standard numbers which represent infinite quantities, yet still obey Peano's Axioms, but are most certainly not what one means by the "standard interpretation" of arithmetic. They are all valid interpretations that match a valid "contract" (in this case some axioms), but they are also very different things, some so different that even different properties and truths are possible, while still matching the "contract".