I know I can create a Java code which is VERY likely to deadlock. There are many ready examples which, when run, will provide a deadlock almost instantly.
However, I'm wondering if it's theoretically possible to write a Java code which absolutely guarantees a deadlock?
That is, by analyzing such code one can prove there will be a deadlock?