- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMain.java
More file actions
Latest commit
60 lines (41 loc) · 1.92 KB
/
Copy pathMain.java
File metadata and controls
60 lines (41 loc) · 1.92 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
publicclassMain {
publicstaticvoidmain(String[] args) {
System.out.println("Enter Text >");
// create an event source - reads from stdin
finalEventSourceeventSource = newEventSource();
// create first observer
finalResponseHandler1responseHandler1 = newResponseHandler1();
// subscribe the observer to the event source
eventSource.addObserver(responseHandler1);
// create second observer
finalResponseHandler2responseHandler2 = newResponseHandler2();
// subscribe the observer to the event source
eventSource.addObserver(responseHandler2);
// starts the event thread
Threadthread = newThread(eventSource);
thread.start();
///////////////Prototype Demo ///////////////
BufferedReaderbr =newBufferedReader(newInputStreamReader(System.in));
System.out.print("Enter Employee Id: ");
inteid=Integer.parseInt(br.readLine());
System.out.print("\n");
System.out.print("Enter Employee Name: ");
Stringename=br.readLine();
System.out.print("\n");
System.out.print("Enter Employee Designation: ");
Stringedesignation=br.readLine();
System.out.print("\n");
System.out.print("Enter Employee Address: ");
Stringeaddress=br.readLine();
System.out.print("\n");
System.out.print("Enter Employee Salary: ");
doubleesalary= Double.parseDouble(br.readLine());
System.out.print("\n");
EmployeeRecorde1=newEmployeeRecord(eid,ename,edesignation,esalary,eaddress);
e1.showRecord();
System.out.println("\n");
EmployeeRecorde2=(EmployeeRecord) e1.getClone();
e2.showRecord();
///////////////End Prototype Demo ///////////////
}
}