Advertisement
Guest User

TroublingRankBugs

a guest
Oct 14th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. public class TroublingRankBugs {
  2.  
  3.  
  4.     private void sync() {
  5.         synchronized (this) {
  6.         }
  7.     }
  8.  
  9.  
  10.     private void sleep() throws InterruptedException {
  11.         synchronized (this)
  12.         {
  13.             Thread.sleep(5000);
  14.         }
  15.     }
  16.  
  17.  
  18.     public static void main(String[] args) throws InterruptedException {
  19.         TroublingRankBugs instance = new TroublingRankBugs();
  20.         instance.sync();
  21.         instance.sleep();
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement