forked from ramram43210/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSchool.java
More file actions
33 lines (25 loc) · 672 Bytes
/
Copy pathSchool.java
File metadata and controls
33 lines (25 loc) · 672 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
import java.util.ArrayList;
public class School
{
static ArrayList<Child> childList;
static
{
childList = new ArrayList<Child>();
Child john = new Child("John");
Child steve = new Child("Steve");
Child rohit = new Child("Rohit");
Child sonu = new Child("Sonu");
childList.add(john);
childList.add(steve);
childList.add(rohit);
childList.add(sonu);
}
public static void doHealthCheckup()
{
ChildSpecialistDoctor childSpecialistDoctor = new ChildSpecialistDoctor("Dr.Smith");
for( Child child : childList )
{
child.accept(childSpecialistDoctor);
}
}
}