You'll have a lot of problems writing Java, especially multi-threaded code, if you can't understand these simple ideas:
- Pre-conditions are the things that must be true before a method is called. The method tells clients "this is what I expect from you".
- Post-conditions are the things that must be true after the method is complete. The method tells clients "this is what I promise to do for you".
- Invariants are the things that are always true and won't change. The method tells clients "if this was true before you called me, I promise it'll still be true when I'm done".
They're all part of an idea called "programming by contract". It was invented by a guy namedC.A.R. Hoare. Bertrand Meyer built an object oriented language called Eiffel around it. No one uses it much, but he had a day in the sun because of it.
Eiffel isn't very popular. There are over four million questions on SO as I write this, but only 32 of them are tagged "eiffel".
I stand corrected - thank you, flamingpenguin. I've updated my answer.