Interface1[] intt = new Interface1[] { new Dog("dddddd") };
for (int i = 0; i < intt.Length; i++)
{
intt[i].GGG();
}
interface Interface1
{
void GGG();
}
class Dog : Pet,Interface1
{
public void GGG()
{
Console.WriteLine("爬树");
}
}
Interface1[] intt = new Interface1[] { new Dog("dddddd") };
for (int i = 0; i < intt.Length; i++)
{
intt[i].GGG();
}