'c# foreach'에 해당되는 글 1건

  1. 2010.03.24 Foreach문
2010. 3. 24. 16:46
Foreach

배열과 같은 컬렉션(컨테이너)에 있는 각 요소에대해 특정한 구문을 반복
배열, System.Collenctions, IEnumerable, System.Collections.Generic, IEnumerable<T>


ArrayList list;

private static void ExamForeach()        
            
            foreach (Object o  in list) 
            {
                Console.WriteLine(o.Tostring()); //리스트안에 모든 객체들의 Tostring 함수가 실행된다.
            }
        }

'.NET > C#' 카테고리의 다른 글

직렬화  (0) 2010.03.27
AS, IS  (0) 2010.03.25
Catch(Exception)  (0) 2010.03.25
Delegate  (0) 2010.03.25
사칙연산 프로그램  (0) 2010.03.24
Posted by 아몰라
이전버튼 1 이전버튼