In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to use the params,Ref,out keyword in C#, which has a certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let's take a look at it.
You can study some of the original operations before these three keywords.
Using System;using System.Collections.Generic;using System.Text;namespace ParamsRefOut {class Program {static void ChangeValue (int I) {iTun5; Console.WriteLine ("The ChangeValue method changed the value" + i.ToString ());} static void Main (string [] args) {int I = 10; Console.WriteLine ("The value of I is" + i.ToString ()); ChangeValue (I) Console.WriteLine ("The value of I is" + i.ToString ()); Console.ReadLine ();}
Observe the running results and find out
The value has not been changed, that is to say, the principle of the operation at this time may be the same as the previous C language function operation.
This article mainly discusses params keyword, ref keyword, out keyword.
1) the params keyword, which is officially interpreted as used in cases where the length of the method parameter is uncertain. Sometimes you can't determine how many method parameters a method has, and you can use the params keyword to solve the problem.
Using System;using System.Collections.Generic;using System.Text;namespace ParamsRefOut {class number {public static void UseParams (params int [] list) {for (int iTuno)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.