摘要: public class SharpNineNewInfo { public static void Show() { //记录 { //init对于类内部属性只能在初始化时赋值 UserInfo user1 = new UserInfo() { Id = 1, UserName = "1" }; 阅读全文
posted @ 2021-04-05 10:36 不骄不傲 阅读(93) 评论(0) 推荐(0) 编辑
摘要: public class SharpEightNewInfo { public enum WeekInfo { MonDay = 1, TuesDay = 2 } public static void Show() { //默认接口函数,接口函数可以直接在接口里实现 { ICustomInterfa 阅读全文
posted @ 2021-04-05 09:42 不骄不傲 阅读(149) 评论(0) 推荐(0) 编辑
摘要: public class SharpSevenNewInfo { public static void Show() { //out变量声明 { //不需要提前声明 int.TryParse("111", out int result); Console.WriteLine(result); //可 阅读全文
posted @ 2021-04-05 09:41 不骄不傲 阅读(44) 评论(0) 推荐(0) 编辑
摘要: public class SharpSixNewInfo { public static void Show() { //条件运算 { Student stu = null; //获取属性对象为空返回null string lastName = stu?.LastName; Console.Writ 阅读全文
posted @ 2021-04-05 09:39 不骄不傲 阅读(35) 评论(0) 推荐(0) 编辑