随笔分类 - C#
摘要:using System; using System.Collections.Generic; using System.Text; namespace test { class Program { static void Main(string[] args) { Date birthday =
阅读全文
摘要:using System; using System.Collections.Generic; using System.Text; namespace test { class Program { static void Main(string[] args) { Time test1 = new
阅读全文
摘要:using System; namespace test { class Program { static void Main(string[] args) { Cat kitty = new Cat(); // 无参构造函数 Cat1 KITTY = new Cat1("KITTY", 4); C
阅读全文
摘要:using System; namespace ConsoleApp3 { class Program { static void Main(string[] args) { Console.Write("你要输入多少项?"); int a = Convert.ToInt32(Console.Rea
阅读全文
摘要:using System; namespace ConsoleApp3 { class Program { static void Main(string[] args) { int b = j1(5); Console.WriteLine(b); int a = j(5); Console.Wri
阅读全文
摘要:using System; namespace class1 { class program { static void Main(string[] args) { Console.Write("请输入a="); double a = double.Parse(Console.ReadLine())
阅读全文
摘要:using System; namespace class1 { class program { static void Main(string[] args) { //值传递引用,实际参数不会变化 Console.Write("请输入a="); double a = double.Parse(Co
阅读全文
摘要:using System; namespace class1 { class program { static void Main(string[] args) { int[][] arry = new int[2][];//这里的行必须定义好,但是列可以不定义好 arry[0] = new int
阅读全文
摘要:using System; namespace ConsoleApp3 { struct WuGong { public string Name; public int Attack; } class Program { static void Main(string[] args) { WuGon
阅读全文
摘要:using System; namespace ConsoleApp3 { class Program { static void Main(string[] args) { int[] a = { 1, 2, 3, 4, 5, 6 };//省略的数组声明方法 for (int i = 0; i <
阅读全文
摘要:using System; namespace program { enum WeekDays { a,//0 b,//1 c = 11,//11 赋值以后就变成11,不赋值就是2 d,//12 e,//13 f,//14 g//15 }//不能输入数字 struct student { publi
阅读全文
摘要:using System; namespace program { class program1 { static void Main(string[] args) { int a = 100; int b = 100; Console.WriteLine("下面使用竖式计算结果"); Consol
阅读全文
摘要:using System; namespace program { class program1 { static void Main(string[] args) { program1 fenshu = new program1(); fenshu.Panduan(); program1 tian
阅读全文
摘要:using System; namespace program { class program1 { static void Main(string[] args) { int a = 4, b = 5, c = 6; int p = (a + b + c) / 2; doub...
阅读全文
摘要:using System; namespace HELLO { class Program { int week; int y, m, d; static void Main(string[] args) { int y, m, d; Console.WriteLine("请输入年月日"); Console.WriteLine("现在请输入年份"); y = int.Parse(Console.R
阅读全文
摘要:【知识梳理】 - 类是一个抽象的存在,就像工业生产中的图纸一样 - 构造函数是一个类的初始化过程 【课堂要求】 - 大致了解类的概念 - 了解构造函数的作用
阅读全文
摘要:using System; namespace 排序案例 { class Program { static void Main(string[] args) { //定义随机数列 int a, b, c, d; Random rand = new Random(); ...
阅读全文
摘要:转自:https://blog.csdn.net/a980433875/article/details/12231673 Visual Studio 中有很多代码段都可以直接简写然后按TAB快速输入编译器中,为了提高编程效率,特此查阅资料,罗列总结。 1. ~ 创建析构函数 ~Program() {
阅读全文
摘要:一、封装 隐藏对象的属性和实现细节,仅对外公开接口,控制在程序中属性的读取和修改的访问级别。 简单来多,就是讲我们所需要的代码打包封装进入一个类里面,便于我们调用,操作。这就是封装。 这样就隔离了具体的变化,便于使用,提高了复用性和安全性。 二、继承 继承可以使得子类具有父类的属性和方法或者重新定义
阅读全文

浙公网安备 33010602011771号