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<Class1> kkk()
        {
            return new List<Class1> {
    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#中的命名实参
网页路径:https://www.cdcxhl.com/article12/iihhgc.html

成都网站建设公司_创新互联,为您提供用户体验网站建设响应式网站微信小程序网页设计公司域名注册

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

成都app开发公司