Created
August 3, 2015 18:37
-
-
Save Anonymus1/2a17f9f5ec735887bd99 to your computer and use it in GitHub Desktop.
tutorial 1 for newboston
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
import org.omg.PortableServer.POAPackage.AdapterNonExistent; | |
import java.util.Random; | |
public class Anonymus implements Runnable{ | |
String name; | |
int time; | |
Random rand = new Random(); | |
public Anonymus(String s){ | |
name = s; | |
time = rand.nextInt(1000); | |
} | |
public void run() { | |
try{ | |
System.out.printf("%s is sleeping for %d%n", name, time); | |
Thread.sleep(time); | |
System.out.printf("%s is done", name); | |
} catch(Exception e){ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment