Advertisement
sergAccount

Untitled

Mar 21st, 2021
816
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.mycompany.app24;
  7.  
  8. /**
  9.  *
  10.  * @author Admin
  11.  */
  12. public class MyCounterTask implements Runnable{
  13.    
  14.     private SynchronizedCounter c;
  15.    
  16.     public MyCounterTask(SynchronizedCounter c){
  17.         this.c = c;
  18.     }
  19.  
  20.     @Override
  21.     public void run() {
  22.         c.inc();
  23.         c.dec();
  24.     }    
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement