Created
November 15, 2012 09:37
-
-
Save Frdnspnzr/4077674 to your computer and use it in GitHub Desktop.
Ententhread
This file contains 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
package ente; | |
public class EntenThread extends Thread { | |
public static boolean maybe = false; | |
public static boolean isUserADuck() { | |
return maybe; | |
} | |
@Override | |
public void run() { | |
while (!isUserADuck()) { | |
System.out.print("Ente "); | |
try { | |
Thread.sleep(500); | |
} catch (InterruptedException e) { | |
//That's how I wake up! | |
System.out.print("Ente Ente Ente Ente "); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment