using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;
namespace Test10_3{ interface ImyInterface1 { int Add(); } interface ImyInterface2 { int Add(); } class Myclass:ImyInterface1,ImyInterface2 { public int ImyInterface1.Add() { int x = 3; int y = 7; return x + y; } public int ImyInterface2.Add() { int x = 3; int y = 7; int z = 5; return x + y + z; } } class Program { static void Main(string[] args) { Myclass myclass = new Myclass(); ImyInterface1 imyinterface1 = myclass; ImyInterface2 imyinterface2 = myclass; Console.WriteLine(imyinterface1.Add()); Console.WriteLine(imyinterface2.Add()); Console.ReadLine();
} }}
代码如上,报错行标黄
- 1 回答
- 0 关注
- 874 浏览
添加回答
举报
0/150
提交
取消