-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClient.cs
More file actions
26 lines (23 loc) · 713 Bytes
/
Client.cs
File metadata and controls
26 lines (23 loc) · 713 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace InterfaceExercising
{
class Client
{
static void Main(string[] args)
{
IHuman human;
Theodore theodore1;
human = new Theodore();
//You need to do a cast operation when assigning the interface reference that points to an instance of Theodore to the Theodore reference variable
theodore1 = (Theodore)human;
theodore1.Name = "Fred";
theodore1.Speak("I like public implementations!");
human.Name = "Teddy";
human.Speak("I like C#!");
}
}
}