zoukankan      html  css  js  c++  java
  • 集合初始化器

     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 using System.Threading.Tasks;
     6 
     7 namespace ALTest.Employee
     8 {
     9     class Employee2
    10     {
    11 
    12         public Employee2(string firstName, string lastName)
    13         {
    14             FirstName = firstName;
    15             LastName = lastName;
    16         }
    17 
    18 
    19         public string FirstName { get; private set; }
    20         public string LastName { get; private set; }
    21         public string  Salary { get; set; }
    22         public string Title { get; set; }
    23 
    24     }
    25 }
     1  using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 using System.Threading.Tasks;
     6 
     7 
     8 
     9 namespace ALTest.Employee
    10 {
    11     class Program
    12     {
    13         static void Main(string[] args)
    14         {    
    15             List<Employee2> employees = new List<Employee2>()
    16             {
    17                 new Employee2("in","love"),
    18                 new Employee2("out","love")
    19             };
    20 
    21 
    22             foreach (Employee2 employee2 in employees)
    23             {
    24                 Console.WriteLine("My name :{0} {1}", employee2.FirstName, employee2.LastName);
    25             }
    26 
    27 
    28             Console.ReadKey();
    29         }
    30     }
    31 }
  • 相关阅读:
    mysql常用函数
    主程Ry访谈录
    mongodb spring anno 查询
    mongodb 查询少少优化
    jquery table thead drop
    ubuntu 配置java,eclipse ,flex,zend,php,TomCat环境
    mongodb shell
    TCP/IP Sockets in Java 源码
    java 断点下载
    直线生成 DDA
  • 原文地址:https://www.cnblogs.com/Artemisblog/p/3670558.html
Copyright © 2011-2022 走看看