摘要:
public class Person { // 字段 private string name; private int age; private string sex; // 属性 public string Name { get { return name; } set { sex = valu 阅读全文
posted @ 2018-05-15 19:34
朱小勇
阅读(116)
评论(0)
推荐(0)
摘要:
https://www.cnblogs.com/leicao/p/5251090.html 委托是一种存储函数引用的类型,在事件和事件的处理时有重要的用途 通俗的说,委托是一个可以引用方法的类型,当创建一个委托,也就创建一个引用方法的变量,进而就可以调用那个方法,即委托可以调用它所指的方法。 委托的 阅读全文
posted @ 2018-05-15 19:26
朱小勇
阅读(139)
评论(0)
推荐(0)
摘要:
只由参数签名(个数,顺序,类型)来区别,返回值不做判断,即两个重载的函数可以返回值不同,也可相同 阅读全文
posted @ 2018-05-15 19:14
朱小勇
阅读(142)
评论(0)
推荐(0)
摘要:
ps: 1、传入的参数必须是变量(不能是字符串常量或者const),且必须初始化;在函数声明和调用都要用ref 2、也可用out代替上面的ref,但是out的变量可以不用初始化 阅读全文
posted @ 2018-05-15 18:58
朱小勇
阅读(96)
评论(0)
推荐(0)
摘要:
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Ch06Ex03 { class Program { static int SumVals(params i 阅读全文
posted @ 2018-05-15 18:53
朱小勇
阅读(371)
评论(0)
推荐(0)
摘要:
static void Write() { Console.WriteLine("Text output from function."); } ps:必须声明为static 阅读全文
posted @ 2018-05-15 18:46
朱小勇
阅读(94)
评论(0)
推荐(0)
摘要:
foreach循环对数组内容进行只读访问,所以不能改变任何元素的值 string[] friendNames = { "Robert Barwell", "Mike Parry", "Jeremy Beacock" }; foreach(string friendName in friendName 阅读全文
posted @ 2018-05-15 18:38
朱小勇
阅读(110)
评论(0)
推荐(0)
摘要:
1、 struct route { public orientation direction; public double distance; } 2、带函数的结构体 struct CustomerName { public string firstName,lastName; public str 阅读全文
posted @ 2018-05-15 18:35
朱小勇
阅读(120)
评论(0)
推荐(0)
摘要:
1、一维数组 string[] friendNames = { "Robert Barwell", "Mike Parry", "Jeremy Beacock" }; 2、多维数组 二维数组的定义格式: <baseType>[,]<name>;//2维double[,] 多维数组的定义格式:<bas 阅读全文
posted @ 2018-05-15 18:35
朱小勇
阅读(164)
评论(0)
推荐(0)
摘要:
enum orientation:byte { north =1, south =2, east =3, west=4 } 注意:声明在代码的主体之外 阅读全文
posted @ 2018-05-15 18:28
朱小勇
阅读(390)
评论(0)
推荐(0)