Skip to content

Instantly share code, notes, and snippets.

@thypon thypon/Shrodinger.java
Last active Aug 29, 2015

Embed
What would you like to do?
May be alive
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
You can’t perform that action at this time.