package coolbeans; import java.util.ArrayList; import coolbeans.Bean; public class CoolBeans { public static boolean weCool(ArrayList<Bean> beans) { for (Bean bean : beans) { if (!bean.isCool()) { System.out.println("Not cool."); return false; } } System.out.println("We cool."); return true; } public static void main(String[] args) { ArrayList<Bean> beans = new ArrayList<>(); beans.add(new Bean(true)); beans.add(new Bean(false)); weCool(beans); beans.get(1).beCool(true); weCool(beans); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15129 | zachwhaley | Add practice directory |