Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package com.mycompany.app24;
- /**
- *
- * @author Admin
- */
- public class Main4 {
- //
- public static void main(String[] args) {
- // объект типа Counter - используется несколькими потоками
- //Counter c = new Counter();
- SynchronizedCounter c = new SynchronizedCounter();
- // объект типа Counter - используется несколькими потоками
- Thread th1 = new Thread(new MyCounterTask(c));
- Thread th2 = new Thread(new MyCounterTask(c));
- th1.start();
- th2.start();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement