Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import java.util.Random;
  2.  
  3. public class Start {
  4.  
  5. public static boolean value;
  6.  
  7. public static void main(String[] args){
  8. Thread thread = new Thread(){
  9. @Override
  10. public void run(){
  11. random();
  12. }
  13. };
  14. thread.start();
  15. while(true){
  16. if(value) System.out.println("Done");
  17. }
  18. }
  19.  
  20. public static void random(){
  21. while(true){
  22. value = new Random().nextInt(5) == 0;
  23. }
  24. }
  25.  
  26. }
  27.  
  28. while(true){
  29. System.out.print(""); //Modification
  30. if(value) System.out.println("Done");
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement