import java.util.ArrayList;
import java.util.Arrays;
public class _Quiz_10 {
public static void main(String[] args) {
Customer c1 = new Customer("์ฑ๋ค๋ฌ", 50);
Customer c2 = new Customer("๋ ์ด์ฒผ", 42);
Customer c3 = new Customer("๋ชจ๋์นด", 21);
Customer c4 = new Customer("๋ฒค์๋ฏผ", 18);
Customer c5 = new Customer("์ ์์ค", 5);
System.out.println("๋ฏธ์ ๊ด ์
์ฅ๋ฃ");
System.out.println("-----------------");
ArrayList<Customer> list = new ArrayList<>(Arrays.asList(c1,c2,c3,c4,c5));
list.stream().map(a -> a.age>20? a.name+ " : 5000์": a.name + " : ๋ฌด๋ฃ").forEach(System.out::println);
}
}
class Customer {
public String name;
public int age;
public Customer(String name, int age) {
this.name = name;
this.age = age;
}
}
0