첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

TestProject.zip
0.00MB

▶ Employee.cs

namespace TestProject
{
    /// <summary>
    /// 직원
    /// </summary>
    public class Employee
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Property
        ////////////////////////////////////////////////////////////////////////////////////////// Public

        #region 직원 ID - EmployeeID

        /// <summary>
        /// 직원 ID
        /// </summary>
        public int EmployeeID { get; set; }

        #endregion
        #region 성명 - Name

        /// <summary>
        /// 성명
        /// </summary>
        public string Name { get; set; }

        #endregion
        #region 나이 - Age

        /// <summary>
        /// 나이
        /// </summary>
        public int Age { get; set; }

        #endregion
    }
}

 

728x90

 

▶ Program.cs

using System;
using System.Collections.Generic;

namespace TestProject
{
    /// <summary>
    /// 프로그램
    /// </summary>
    class Program
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Static
        //////////////////////////////////////////////////////////////////////////////// Private

        #region 프로그램 시작하기 - Main()

        /// <summary>
        /// 프로그램 시작하기
        /// </summary>
        private static void Main()
        {
            List<Employee> list = new List<Employee>();

            list.Add(new Employee { EmployeeID = 1, Name = "김철수", Age = 20 });
            list.Add(new Employee { EmployeeID = 2, Name = "홍길동", Age = 30 });
            list.Add(new Employee { EmployeeID = 3, Name = "김순희", Age = 25 });

            list.RemoveAll(employee => employee.Age > 25);

            foreach(Employee employee in list)
            {
                Console.WriteLine(employee.Name);
            }
        }

        #endregion
    }
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요