Because explicitly implemented members are always implicitly private, these members are no
longer available from the object level. In fact, if you were to apply the dot operator to an Octagon
type, you will find that IntelliSense will not show you any of the Draw() members (see Figure 9-8).
Figure 9-8.
Explicitly implemented interface members are not exposed from the object level.
As expected, you must make use of explicit casting to access the required functionality. For
example:
static void Main(string[] args)
{
Console.WriteLine("***** Fun with Interface Name Clashes *****\n");
Octagon oct = new Octagon();
Do'stlaringiz bilan baham: