摘要:
面向对象 1、数据封装 2、代码重用 3、多态性 4、重载命名空间 using [alias=]namespace;声明自己的类 1、封装数据 private int count; ... ... 2、构造和析构 构造:public 类名(...) {...},可存在多个 ~类名:析构,一般不需要 ... 阅读全文
摘要:
1、一维数组 1) int[] intArray = new int[10]; 2) int[] intArray; intArray = new int[10]; 3) int[] intArray = new int[10]{1,2,3,4,5,6,7,8,9,0}; 注意:不允许初始化部分元素,必须全部初始化2、多维数组 1) int[,] int... 阅读全文
摘要:
1、if语句 1)if(...) 2)if(...) else 3)if(...) else if(...) else if(...) else 注意嵌套的判断语句,从最内层开始,else总是和他最上面并且没有配对的if语句配对2、switch语句 switch(...) { case ... ... 阅读全文
摘要:
1、算术运算符 1)++、--在变量左右的区别 2)负号运算符:例如-3+-3等同于-3-32、逻辑运算符3、关系运算符4、其他运算符 1)is运算符:x is int 2)?:运算符: 3)as运算符: object x = 5.4F; object y; y = x as float; 4)t... 阅读全文