public class _02_ArrayLoop {
public static void main(String[] args) {
//๋ฐฐ์ด์ ์ํ
String[] coffees = {"์๋ฉ๋ฆฌ์นด๋
ธ","์นดํ๋ชจ์นด","๋ผ๋ผ","์นดํธ์น๋
ธ"};
for (int i = 0; i <4 ; i++) {
System.out.println(coffees[i] + " ํ๋");
}
System.out.println("์ฃผ์ธ์");
System.out.println("-------------");
//๋ฐฐ์ด์ ๊ธธ์ด๋ฅผ ์ด์ฉํ ์ํ
for (int i=0; i<coffees.length;i++){
System.out.println(coffees[i] + " ํ๋");
}
System.out.println("์ฃผ์ธ์");
System.out.println("-------------");
//enhanced for (for-each) ๋ฐ๋ณต๋ฌธ
for (String coffee : coffees) {
System.out.println(coffee + " ํ๋");
}
System.out.println("์ฃผ์ธ์");
}
}