Last active
August 29, 2015 14:10
-
-
Save thypon/98b87bac86cc566bf888 to your computer and use it in GitHub Desktop.
May be alive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Shrodinger { | |
static int DEAD = 0; | |
static int ALIVE = 1; | |
int status; | |
} | |
class Main { | |
stativ void main() { | |
Shrodinger cat = new Shrodinger(); | |
cat.status = Shrodinger.DEAD; | |
try { | |
new Thread(() => cat.status = Shrodinger.ALIVE); | |
if (Shrodinger.ALIVE) { | |
println("The cat is alive"); | |
} else { | |
println("The cat is dead"); | |
} | |
catch (ThreadException te) { | |
println("The cat is neither alive or dead"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment