title: package java.util.function does not exist?
body: <p>I'm a newbie to Java and now learning <a href="http://docs.oracle.com/javase/tutorial/java/TOC.html" rel="nofollow">The Java Tutorials</a>. When I typed the exactly code in <code>LabmdaScopeTest.java</code>, I encountered the error <code>package java.util.funciton does not exist</code>. The code is as below.</p>
  
  <pre><code>import java.util.funciton.Consumer;
  
  public class LambdaScopeTest {
  
  public int x = 0;
  
  class FirstLevel {
  
      public int x = 1;
  
      void methodInFirstLevel(int x) {
  
          // The following statement causes the complier to generate
          // the error "local variables referenced from a lambda expression
          // must be final or effectively final" in statemen A:
          //
          // x = 99;
  
          Consumer&lt;Integer&gt; myConsumer = (y) -&gt;
          {
              System.out.println("x = " + x); // statement A
              System.out.println("y = " + y);
              System.out.println("this.x = " + this.x);
              System.out.println("LambdaScopeTest.this.x = " + 
                  LambdaScopeTest.this.x);
          };
  
          myConsumer.accept(x);
      }
  }
  
  public static void main(String[] args) {
      LambdaScopeTest st = new LambdaScopeTest();
      LambdaScopeTest.FirstLevel fl = st.new FirstLevel();
      fl.methodInFirstLevel(23);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I commented the <code>import</code> statement and replaced the code to <code>java.util.function.Consumer&lt;Integer&gt; myConsumer</code> and everything became okay.</p>