自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

C#參數(shù)數(shù)列簡(jiǎn)單概述

開發(fā) 后端
這里介紹C#參數(shù)數(shù)列,在微軟的.NET推出后,關(guān)于C#的有關(guān)文章也相繼出現(xiàn),作為微軟的重要的與JAVA抗衡的語(yǔ)言,C#具有很多優(yōu)點(diǎn)。

在向大家詳細(xì)介紹C#參數(shù)數(shù)列之前,首先讓大家了解下C#種的四種參數(shù)形式,然后全面介紹C#參數(shù)數(shù)列。

在微軟的.NET推出后,關(guān)于C#的有關(guān)文章也相繼出現(xiàn),作為微軟的重要的與JAVA抗衡的語(yǔ)言,C#具有很多優(yōu)點(diǎn)。本文將選一些C#語(yǔ)言中的重要知識(shí)詳細(xì)介紹

C#種的四種參數(shù)形式:
◆一般參數(shù)
◆in參數(shù)
◆out參數(shù)
◆C#參數(shù)數(shù)列
本文只介紹C#參數(shù)數(shù)列

C#參數(shù)數(shù)列

C#參數(shù)數(shù)列能夠使多個(gè)相關(guān)的參數(shù)被單個(gè)數(shù)列代表,換就話說,C#參數(shù)數(shù)列就是變量的長(zhǎng)度。

  1. using System;  
  2.  
  3. class Test  
  4. {  
  5. static void F(params int[] args) {  
  6. Console.WriteLine("# 參數(shù): {0}", args.Length);  
  7. for (int i = 0; i < args.Length; i++)  
  8. Console.WriteLine("\targs[{0}] = {1}", i, args[i]);  
  9. }  
  10.  
  11. static void Main() {  
  12. F();  
  13. F(1);  
  14. F(1, 2);  
  15. F(1, 2, 3);  
  16. F(new int[] {1, 2, 3, 4});  
  17. }  
  18. }  
  19.  
  20. 以下為輸出結(jié)果:  
  21.  
  22. # 參數(shù): 0  
  23. # 參數(shù): 1  
  24. args[0] = 1  
  25. # 參數(shù): 2  
  26. args[0] = 1  
  27. args[1] = 2  
  28. # 參數(shù): 3  
  29. args[0] = 1  
  30. args[1] = 2  
  31. args[2] = 3  
  32. # 參數(shù): 4  
  33. args[0] = 1  
  34. args[1] = 2  
  35. args[2] = 3  
  36. args[3] 

【編輯推薦】

  1. C#創(chuàng)建表單簡(jiǎn)單介紹
  2. C#修改DataReader默認(rèn)行為
  3. C#設(shè)置CooperativeLevel概述
  4. C#表單增加控件簡(jiǎn)單描述
  5. C# EmployeePlug類概述
責(zé)任編輯:佚名 來源: 博客園
相關(guān)推薦

2009-09-04 13:31:33

C#抽象類

2009-09-04 18:00:54

C#數(shù)據(jù)訪問層

2009-08-14 17:27:56

C#方法參數(shù)

2009-08-25 09:58:56

C#參數(shù)不同點(diǎn)

2009-08-18 17:29:02

C#使用指針

2009-08-18 09:26:07

C#線程功能

2009-08-13 15:18:23

C#文件上傳

2009-08-31 09:44:23

C# Employee

2009-07-31 14:08:54

C# 匿名函數(shù)

2009-09-03 11:15:38

C#設(shè)置Coopera

2009-08-25 10:08:39

C# MyData對(duì)象

2009-08-19 11:09:00

C# Cast<T>

2009-08-24 18:09:13

C#構(gòu)造函數(shù)

2009-08-20 16:28:45

C#匿名方法

2009-08-25 16:49:44

C#使用if語(yǔ)句

2009-08-17 09:57:00

C# Windows

2009-09-03 10:42:16

C# Employee

2009-08-03 18:26:18

C#定義接口成員

2009-08-06 09:32:03

C#代碼協(xié)同執(zhí)行

2009-08-07 17:19:50

C#調(diào)用外部進(jìn)程
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)