CODEKILLER

반응형

List<T> 출력예제
List<T> 출력예제

using System.Text;

public class Example
{
    public static void Main()
    {
        DisplayListT();
    }

    private static void DisplayListT()
    {
        var theCollections = new List<Codekiller>
        {
            new Codekiller() { Name="honggildong", Age=47},
            new Codekiller() { Name="superman", Age=25},
            new Codekiller() { Name="batman", Age=0},
            new Codekiller() { Name="catman", Age=3}
        };

        foreach (Codekiller col in theCollections)
        {
            Console.WriteLine(col.Name + "  " + col.Age);
        }
    }
}

public class Codekiller
{
    public string Name { get; set; }
    public int Age { get; set; }
}
반응형

공유하기

facebook twitter kakaoTalk kakaostory naver band