Skip to content

Instantly share code, notes, and snippets.

@honux77
Last active January 5, 2021 17:08
Show Gist options
  • Save honux77/5e442fa10eaf2c6261ef24d29daa1a2e to your computer and use it in GitHub Desktop.
Save honux77/5e442fa10eaf2c6261ef24d29daa1a2e to your computer and use it in GitHub Desktop.
Success!
package net.honux;
public class Quantum extends Thread {
static int a;
public static void main(String[] args) {
Thread t = new Quantum();
t.start();
int count = 0;
boolean loop = true;
while(loop) {
if (a == 0 && a == 1) {
System.out.println("Finally!");
loop = false;
}
count++;
System.out.println(count);
}
System.out.printf("Total count: " + count);
}
@Override
public void run() {
while(true) {
a = 0;
a = 1;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment