2020年6月1日

摘要: list泛型的用法和示例 using System; using System.Collections.Generic; //必须引用 using System.Linq; using System.Text; namespace _07List泛型集合 { class Program { stat 阅读全文
posted @ 2020-06-01 21:23 g_ices 阅读(233) 评论(0) 推荐(0) 编辑
 
摘要: 对象初始化器 要使用对象初始化器,那么这个对象必须有一个无参构造方法,如果你给这个方法写了一个有参构造方法而将它的默认无参构造方法覆盖了并且没有提供一个新的无参构造方法,那么使用对象初始化器编译的时候是不会通过的 namespace Ant17 { /// <summary> /// 对象初始化器( 阅读全文
posted @ 2020-06-01 19:16 g_ices 阅读(140) 评论(0) 推荐(0) 编辑
 
摘要: 构造方法 相当于python的 初始化类 init 用于初始化,一个类中至少有一个 用new关键字调用 不能有返回值 方法名和类名一样 using System; using System.Collections.Generic; using System.Linq; using System.Te 阅读全文
posted @ 2020-06-01 19:04 g_ices 阅读(101) 评论(0) 推荐(0) 编辑
 
摘要: 方法重载: 方法名称相同,但是参数不同 需求: 解决多个方法的重命名问题 好处,方便使用 编译器判断的依据: 同名 参数类型不一样 参数个数不一样 参数顺序不一样 跟返回值无关 using System; using System.Collections.Generic; using System. 阅读全文
posted @ 2020-06-01 18:35 g_ices 阅读(38) 评论(0) 推荐(0) 编辑
 
摘要: 数组有什么用 在同时声明多个同类型的变量的时候 非常适合用数组来声明 数组定义 string[] names = new string[3] { "小张", "小王", "小明" }; string[] names2 = new string[] { "小张", "小王", "小明", str3 } 阅读全文
posted @ 2020-06-01 15:31 g_ices 阅读(39) 评论(0) 推荐(0) 编辑
 
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Ant11 { /// <summary> // 阅读全文
posted @ 2020-06-01 15:29 g_ices 阅读(71) 评论(0) 推荐(0) 编辑
 
摘要: 什么是对象呢,简单的说:万物皆对象. 说到对象,就要说说什么是类了:类是对事物的一种抽象定义,将抽象之后的特征和行为有机结合便构成了类,类是具有共同特征和行为的一类事物的统称. 举个简单的例子,人类就是一个类,那么每一个人就是具体的对象.对象本身是具体的,是客观存在的,而类则是一个抽象的概念,并非客 阅读全文
posted @ 2020-06-01 15:20 g_ices 阅读(81) 评论(0) 推荐(0) 编辑
 
摘要: for循环 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Ant10 { /// <summa 阅读全文
posted @ 2020-06-01 15:18 g_ices 阅读(209) 评论(0) 推荐(0) 编辑
 
摘要: 新建一个windows窗体应用 窗体属性 修改窗体标题 构建窗体 双击确认button 编写按钮触发事件 private void button1_Click(object sender, EventArgs e) { string numStr = this.txtNumber.Text; //S 阅读全文
posted @ 2020-06-01 15:17 g_ices 阅读(334) 评论(0) 推荐(0) 编辑
 
摘要: if else语句: if 是如果的意思,else if是否则如果的意思,else是其他情况的意思 static void Main(string[] args) { string hello = "晚上"; if(hello=="上午"/*条件*/) { //写我们需要打印的语句 Console. 阅读全文
posted @ 2020-06-01 15:06 g_ices 阅读(97) 评论(0) 推荐(0) 编辑
 
摘要: 算术运算符 + - * / %(取余) 关系运算符 >, >=, <, <=, ==, != 逻辑运算符 &&(与) ||(或) !(非) 赋值运算符 = 阅读全文
posted @ 2020-06-01 15:05 g_ices 阅读(107) 评论(0) 推荐(0) 编辑
 
摘要: 基本命名规则 //全大写下划线命名, 使用于常量 //Pascal <帕斯卡命名法> 适用类名、方法名。 //Camel <驼峰命名法> 适用局部变量、全局变量、方法的参数。 public const int MAX_VALUE = 10; string registryKey = "Brand"; 阅读全文
posted @ 2020-06-01 15:04 g_ices 阅读(131) 评论(0) 推荐(0) 编辑
 
摘要: 什么是变量 变量来源于数学,是计算机语言中能储存计算结果或能表示值抽象概念。 变量可以通过变量名访问。在指令式语言中,变量通常是可变的;但在纯函数式语言(如Haskell)中,变量可能是不可变(immutable)的。在一些语言中,变量可能被明确为是能表示可变状态、具有存储空间的抽象(如在Java和 阅读全文
posted @ 2020-06-01 15:03 g_ices 阅读(107) 评论(0) 推荐(0) 编辑
 
摘要: 代码加注释是为了便于阅读代码 单行注释: //+注释语句 多行注释 /* 多行注释 注释语句 */ 文档注释 方法类注释(解释类或方法的主要功能,参数详解) /// /// asdasd /// 阅读全文
posted @ 2020-06-01 15:02 g_ices 阅读(110) 评论(0) 推荐(0) 编辑
 
摘要: using System; //using引入的意思, System命名空间 using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; // 命名空间-- 阅读全文
posted @ 2020-06-01 15:01 g_ices 阅读(99) 评论(0) 推荐(0) 编辑
 
摘要: 选择windows平台 选择控制台应用 配置新项目 配置字体大小及颜色 点击工具>选项 背景颜色 字体设置 阅读全文
posted @ 2020-06-01 15:00 g_ices 阅读(268) 评论(0) 推荐(0) 编辑
 
摘要: vs安装 微软官网下载 下载下来一个小的初始安装文件,点击安装 点击继续 等待下载 如果下载不下来或者网速太慢,建议FQ外网下载 选择自己需要的进行下载时安装,其他的需要时再安装 阅读全文
posted @ 2020-06-01 14:56 g_ices 阅读(2188) 评论(0) 推荐(0) 编辑