static void Main(string[] args)
{
int i; //可以接受一个整数的变量
string str; //可以接受一个字符串的变量
}
public class MyClass
{
public int i { get; set; } //接受整数
public string str { get; set; } //接受字符串
}
static void Main(string[] args)
{
MyClass obj = new MyClass();
obj.i =1;
obj.str ="我是字符串";
}
public string Method(int m,int n)
{
return "";
}
public class Test
{
//这种数据类型可以接受一个方法
public delegate string MethodDelegate(int i1,int i2);
}
class Program
{
//这种数据类型可以接受一个方法
public delegate string MethodDelegate(int i1, int i2);
/// <summary>
/// 我们可以用MethodDelegate声明一个变量来接受方法了
/// </summary>
public void Test()
{
MethodDelegate IamMethod = Method; //把下面那个Method方法赋值给变量了。
var result=IamMethod(1, 2); //然后把这个变量当作方法一样执行即可。
}
public string Method(int m, int n)
{
return "";
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有