[아이템 58] 전통적인 for 문보다는 for-each 문을 사용하라
Closed this issue · 4 comments
kses1010 commented
[아이템 58] 전통적인 for 문보다는 for-each 문을 사용하라
102092 commented
for-each문이 enhanced for statement 의미라는 건 처음 알았네요!
ghojeong commented
이번 아이템은 제곧내 이네요.
저도 for-each
문과 enhanced for statement
의 이름이 같다는 것과
Collection 인터페이스를 구현하지 않더라도 Iterable 은 구현해야한다는 게 인상깊네요.
앞으로는 일급 컬렉션 객체를 만들게 되면 implements Iterable 을 꼭해야겠습니다.
kses1010 commented
인텔리J에선 iter 라고 치면 자동으로 생성해줘서 편하군요
kses1010 commented