forked from venu-shastri/dotnet_fundamentals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterface_assignment.cs
70 lines (50 loc) · 1.35 KB
/
interface_assignment.cs
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
61
62
63
64
65
66
67
68
69
70
public class Family
{
public void Visit(Person obj) {
obj.Friendly();
obj.Laughter();
obj.Mature();
obj.Professional();//hidden
}
}
public class Friend
{
public void Hangout(Person obj) {
obj.Anger();
obj.Friendly();
obj.Laughter();
obj.Mature();
obj.Professional();//Hidden
}
}
public class Office
{
public void Dowork(Person obj)
{
obj.Professional();
obj.Mature();
obj.Anger();//hidden
obj.Friendly();//hidden
}
}
public class Person
{
public void Friendly() {Console.WriteLine("Friendle Behavior"); }
public void Professional() { }
public void Anger() { }
public void Laughter() { }
public void Mature() { }
}
public class Program
{
public static void Main()
{
Person _singlePerson = new Person();
Family __familiyVisit = new Family();
__familiyVisit.Visit(_singlePerson);
Office _workContext = new Office();
_workContext.Dowork(_singlePerson);
Friend _friendCircle = new Friend();
_friendCircle.Hangout(_singlePerson);
}
}