c#中的命名实参

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

创新互联专业为企业提供海口网站建设、海口做网站、海口网站设计、海口网站制作等企业网站建设、网页设计与制作、海口企业网站模板建站服务,十载海口做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。

namespace ConsoleApplication1
{
class Program
{

     class Class1
     {
         readonly string people;
        public string People { get {return people;} }
        readonly decimal price;
        public decimal Price { get { return price; } }
        public Class1(string people, decimal price)
        {
            this.people = people;
            this.price = price;
        }

        public static List kkk()
        {
            return new List {
    new Class1(people:"ssss",price:444m),
    new Class1(people:"44333rrr",price:666m),
    new Class1(people:"dddd",price:88m)

    };

    }
        public override string ToString()
        {
            return string.Format("{0}:{1}",people,price);
        }

        static void Main(string[] args)
        {
           foreach(Class1 jjj in kkk())
           { Console.WriteLine(jjj.people+':'+jjj.price);

           }
           Console.ReadLine();
        }
    }
}

}


网页名称:c#中的命名实参
文章起源:http://lszwz.com/article/iihhgc.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款