Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SharedCounter {
- private int counter ;
- SharedCounter(){
- this.counter = 0 ;
- }
- private void increment(){
- this.counter++ ;
- }
- public int get(){
- return this.counter;
- }
- public void count (){
- for (int i = 0 ; i <= 1000 ; i++){
- increment();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement