title: JAVA IceCreamProject couldn't run
body: <p>This project couldn't run.Please help me.
  <a href="http://pastebin.com/FX3JdUqb" rel="nofollow">http://pastebin.com/FX3JdUqb</a></p>
  
  <p><code>IceCreamFlavor printPurchasedIceCreams()</code>
  this method is just return all ice creams in ArrayList, below is my code:</p>
  
  <p><strong>IceCreamShopMain.java:</strong></p>
  
  <pre><code>public class IceCreamShopMain {
      public static void main(String[] args) {
          System.out.println(IceCreamFlavor.HAZELNUT.getName());
          System.out.println("The price of ice-cream is " + IceCreamFlavor.HAZELNUT.getPrice() + " dollars.");
          Customer c = new Customer(IceCreamFlavor.WHIPPEDCREAM);
          c.setCustomerName("Amy");
          Customer c2 = new Customer(IceCreamFlavor.ALMOND, "Mawson");        
          System.out.println(c.getCustomerName() + "`s purchased items are " + c.printPurchasedIceCreams() + ".");
          c.buy(IceCreamFlavor.OREOCOOKIECRUMBLES);
          System.out.println(c.printPurchasedIceCreams());
          System.out.println(c.icecream.getName());
          System.out.println(c2.getCustomerName() + " bought " + c2.icecream.getName() + "-Ice"
                  + " which was " + c2.icecream.getPrice() + " dollars.");
          Customer c3 = new Customer(IceCreamFlavor.OREOCOOKIECRUMBLES, "Mickey");
          c3.buy(IceCreamFlavor.ALMOND);
          c3.buy(IceCreamFlavor.WHIPPEDCREAM);
          System.out.println(c3.printPurchasedIceCreams());
  
      }
  }
  </code></pre>
  
  <p><strong>Customer.java:</strong></p>
  
  <pre><code>import java.util.*;
  public class Customer {
      public IceCreamFlavor icecream;
      public int price;
      private String customerName;
      static String hamper;
  
      List&lt;IceCreamFlavor&gt; purchasedIceCreams = new ArrayList&lt;IceCreamFlavor&gt;();
  
  
      Customer(IceCreamFlavor icecream) {
          this.icecream = icecream;
      }
  
      Customer(IceCreamFlavor icecream, String customerName) {
          this.icecream = icecream;
          this.customerName = customerName;
      }
  
  //  String getName() {
  //      return icecream.getName();
  //  }
  //
  //  int getPrice() {
  //      return icecream.getPrice();
  //  }
  
      String getCustomerName() {
          return this.customerName;
      }
  
      void setCustomerName(String customerName) {
          this.customerName = customerName;
  
      }
  
      void buy(IceCreamFlavor icecream) {
          // not really sure what business do here
          // just return the Ice cream.
  //      this.icecream = icecream;
          purchasedIceCreams.add(icecream);
  
      }
  
       IceCreamFlavor printPurchasedIceCreams() {
          // not really sure what business do here
          // just return the Ice cream.
          for(int i = 0; i &lt; purchasedIceCreams.size(); i++) {
              purchasedIceCreams.get(i);
  
  
  
          return purchasedIceCreams.get(i);
  
  
          }
       }
  }
  </code></pre>
  
  <p><strong>IceCreamFlavor.java:</strong></p>
  
  <pre><code>enum IceCreamFlavor {
  
      HAZELNUT("Hazelnut", 300), WHIPPEDCREAM("WhippedCream", 270), ALMOND("Almond",
              370), OREOCOOKIECRUMBLES("OreoCookieCrumbles", 500), MARSHMALLOWS("Marshmallows", 420);
  
      public String name;
      public int price;
  
      private IceCreamFlavor(String name, int price) {
          this.name = name;
          this.price = price;
      }
  
      String getName() {
          return name;
      }
  
      int getPrice() {
          return price;
      }
  
  }
  </code></pre>
  
  <p><strong>Error Log:</strong></p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.Error: Unresolved compilation
    problem:      This method must return a result of type IceCreamFlavor</p>
    
    <p>at Customer.printPurchasedIceCreams(Customer.java:45)   at
    IceCreamShopMain.main(IceCreamShopMain.java:8) This method must return
    a result of type   IceCreamFlavor</p>
  </blockquote>