Created
April 23, 2015 08:28
-
-
Save shihyu/7cc50d0fa9aff7cbffa4 to your computer and use it in GitHub Desktop.
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
class MyThread implements Runnable | |
{ | |
private int ticket = 10; | |
public void run() | |
{ | |
for (int i = 0; i < 20; i++) { | |
if (this.ticket > 0) { | |
System.out.println("賣票:ticket" + this.ticket--); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment