-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSynchronizeFbLike.java
More file actions
38 lines (32 loc) · 792 Bytes
/
SynchronizeFbLike.java
File metadata and controls
38 lines (32 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package mthread;
public class SynchronizeFbLike {
public static void main(String[] args) {
/* Facebook Page: Everest, Current Likes: 500 */
final FacebookLike everestFbPagePiclike = new FacebookLike(500);
Thread user1 = new Thread() {
public void run() {
everestFbPagePiclike.plusOne();
}
};
Thread user2 = new Thread() {
public void run() {
everestFbPagePiclike.plusOne();
}
};
Thread user3 = new Thread() {
public void run() {
everestFbPagePiclike.plusOne();
}
};
Thread user4 = new Thread() {
public void run() {
everestFbPagePiclike.plusOne();
}
};
/* User1,2,3,4 hit like button in Everest Facebook Page */
user1.start();
user2.start();
user3.start();
user4.start();
}
}