What are the differences pre condition ,post condition and invariant in computer terminology [closed]
I am reading the book Java Concurrency in Practice and getting a little bit confused with these terms: Pre condition Post condition Invariants Can someone please explain me them (with an example, if it's possible)? 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