C#之方法的定义及调用学习案例
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace MethodExample{ class Program { public int MyMethod() { Console.Writ …… 阅读全文
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace MethodExample{ class Program { public int MyMethod() { Console.Writ …… 阅读全文
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ref_Example{ class Program { public void _ref(ref int i) //参数为引用类型 { …… 阅读全文
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Params_test{ class Program { int Sum(params int[] i) //求不定数量的整数之和 { …… 阅读全文
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Override_test{ public class ComplexClass { public class complex { p …… 阅读全文
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace SampleNamespace{ class SampleClass { public void SampleMethod() { C …… 阅读全文
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace BaseClass_test{ public class BaseClass //基类 { int Number; public BaseCla …… 阅读全文
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace new_test{ public class BClass //基类 { public void DoWork() { …… 阅读全文
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace virtual_test{ public class BClass //基类 { public virtual void DoWork() //虚函 …… 阅读全文