본문 바로가기

WIL(What I Learned)

What does the colon (:) operator do?

https://stackoverflow.com/a/2400046/15011104

 

What does the colon (:) operator do?

Apparently a colon is used in multiple ways in Java. Would anyone mind explaining what it does? For instance here: String cardString = ""; for (PlayingCard c : this.list) // <-- { cardStr...

stackoverflow.com

for (String name : names) {
    // remainder omitted
}

"FOR each name IN names ... "

'WIL(What I Learned)' 카테고리의 다른 글

java ArrayList indexOf()  (0) 2021.08.23
Iterator를 활용해 ArrayList의 모든 요소 출력하기.  (0) 2021.08.20
java input (Scanner class)  (0) 2021.08.16
okky Spring IoC  (0) 2021.08.05
JPA에서 복수의 pk 지정하기  (0) 2021.07.22