随笔分类 -  C#

摘要:以上是代码 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication 阅读全文
posted @ 2020-03-05 00:23 Aquiet 阅读(3811) 评论(0) 推荐(1) 编辑
摘要:ADO.NET五大常用对象 一,SqlConnection(连接对象) 1,配置文件 <connectionStrings> <add name="TestBook" connectionString='Data Source=.;Initial Catalog=TestBook;Integrate 阅读全文
posted @ 2019-12-05 11:27 Aquiet 编辑
摘要:1.1什么是虚方法? 在父类中使用 virtual 关键字修饰的方法, 就是虚方法。在子类中可以使用 override 关键字对该虚方法进行重写。 Virtual方法也可以单独执行。 1.2虚方法语法 父类: public virtual 返回值类型 方法名() { 方法体代码; } 子类: pub 阅读全文
posted @ 2019-11-30 20:46 Aquiet 阅读(911) 评论(0) 推荐(0) 编辑
摘要:面向对象开发有三大特性(特点 / 特征) : 封装, 继承, 多态。我们今天主要讨论封装和继承,多态会在下篇中讨论。 一、封装: 所谓封装,也就是把客观事物封装成抽象的类,并且类可以把自己的数据和方法只让可信的类或者对象操作,对不可信的进行信息隐藏。封装是面向对象的特征之一,是对象和类概念的主要特性 阅读全文
posted @ 2019-11-30 20:28 Aquiet 阅读(701) 评论(1) 推荐(1) 编辑
摘要:构造方法特点: 一 ,与类同名 public class Product { public int ID { get; set; } public String NAME { get; set; } public Decimal Price { get; set; } public ProductT 阅读全文
posted @ 2019-11-22 16:28 Aquiet 阅读(3799) 评论(0) 推荐(0) 编辑
摘要:二维数组: public static void Main(string[] args) { int[,] a = new int[3, 3]; Random rom = new Random(); for (int x = 0; x < a.GetLength(0); x++) { for (in 阅读全文
posted @ 2019-11-20 23:43 Aquiet 阅读(1011) 评论(0) 推荐(0) 编辑
摘要:交错数组:数组元素本身也是一个数组 1 public static void Main(string[] args) 2 { 3 4 int[][] arr = new int[5][]; 5 arr[0] = new int[8]; 6 arr[1] = new int[8]; 7 arr[2] 阅读全文
posted @ 2019-11-20 22:58 Aquiet 阅读(1101) 评论(0) 推荐(0) 编辑
摘要:冒泡算法:先看代码吧,我不喜欢先说一大堆,看不懂了再说 1 class Program 2 3 { 4 static void Main(string[] args) 5 { 6 int[] arr = { 8, 15, 16, 11, 99, 4 }; 7 for (int i = 0; i <a 阅读全文
posted @ 2019-11-18 22:16 Aquiet 阅读(1056) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示