摘要:
ref参数: 能够将一个变量带入一个方法中进行改变,改变完成后,在将改变后的值带出方法。 ref参数要求在方法外必须为其赋值,而方法内可以不赋值。 using System; namespace ref参数 { class Program { static void Main(string[] ar 阅读全文
posted @ 2023-03-19 20:44
春哥博客
阅读(100)
评论(0)
推荐(0)
摘要:
如果你在一个方法中,返回多个相同类型的值的时候,可以考虑返回一个数组 示例: using System; namespace out参数 { class Program { static void Main(string[] args) { //写一个方法,求一个数组中的最大值、最小值、总和、平均值 阅读全文
posted @ 2023-03-19 19:56
春哥博客
阅读(21)
评论(0)
推荐(0)
摘要:
方法的形参和实参: using System; namespace 方法的形参和实参 { class Program { static void Main(string[] args) { //比较两个数字的大小,返回最大的 int a1 = 10; int a2 = 20; int max= Ge 阅读全文
posted @ 2023-03-19 15:21
春哥博客
阅读(25)
评论(0)
推荐(0)

浙公网安备 33010602011771号