-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathMain.java
More file actions
27 lines (23 loc) · 715 Bytes
/
Main.java
File metadata and controls
27 lines (23 loc) · 715 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
package git.assignment;
import git.assignment.ReallySimpleSubscriber;
import git.assignment.Topic;
import git.assignment.Multiplicationseriess;
import git.assignment.SimpleSubscriber;
import git.assignment.ISubscriber;
import java.util.Scanner;
public class GitAssignment {
private static ISubscriber subscribers [] = {
new SimpleSubscriber(),
new ReallySimpleSubscriber(),
new Multiplicationseriess(),
};
public static void main(String[] args) {
Topic mathTopic = new Topic();
for (ISubscriber sub : subscribers) {
mathTopic.addSubscriber(sub);
}
Scanner sc = new Scanner(System.in);
int input = sc.nextInt();
mathTopic.dispatchEvent(input);
}
}