摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ #region//重写父类同名方法 class MyClass { public void ShowMessage() { Console.WriteLine("我是父类"); } } class MyClass1 : MyClass { new public void ShowMessage()... 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ // 继承 #region 父类 class MyClass { private void ShowMessage1() { Console.WriteLine("父类的私有方法"); } public void Showmessage2() { Console.WriteLine("父类的公... 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ // 访问限制. #region 自定义类 class MyClass { private void ShowMessage() // 私有方法, 关键字 Private . 这是也是默认的. { Console.WriteLine("私有的,不能在类的外部被访问"); } public void SH... 阅读全文