Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class apple implements Runnable{
- String name;
- int time;
- Random r = new Random();
- public apple(String s){
- name= s;
- time = r.nextInt(999);
- }
- public void run(){
- try{
- System.out.printf("%s is sleeping for %d\n, name, time");
- Thread.sleep(time);
- System.out.printf("%s is done\n", name);
- }catch(Exception e){}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement