110,567
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace interfaceoo
{
interface myinterface
{
string STR
{
get;
set;
}
void outMethod();
}
class interfaceuse : myinterface
{
string str = "接口实现";
public string STR
{
get { return str; }
set { str = value; }
}
public void outMethod()
{
Console.WriteLine(this.STR);
}
}
class Program
{
static void Main(string[] args)
{
interfaceuse interfaceuser = new interfaceuse();
interfaceuser.outMethod();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 写写吧
{
//interface myinterface
//{
// string STR
// {
// get;
// set;
// }
// void outMethod();
//}
//class interfaceuse : myinterface
class interfaceuse
{
string str = "接口实现";
public string STR
{
get { return str; }
set { str = value; }
}
public void outMethod()
{
Console.WriteLine(this.STR);
}
}
class Program
{
static void Main(string[] args)
{
interfaceuse interfaceuser = new interfaceuse();
interfaceuser.outMethod();
}
}
}