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

▶ Program.cs

using System;
using System.Linq;

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

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

        /// <summary>
        /// 프로그램 시작하기
        /// </summary>
        private static void Main()
        {
            int[] integerArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

            // 에러가 발생한다.
            //Console.WriteLine("11번째 항목 : {0}", integerArray.ElementAt(10));

            Console.WriteLine("11번째 항목 : {0}", integerArray.ElementAtOrDefault(10));
        }

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

댓글을 달아 주세요