Java scanner NullPointerException : <p>i'm trying to make my scanner do some basic console interface, but it keeps returning NullPointerException no matter what i try.
Here is the some of code:</p>

<pre><code>public static void main(String[] args) {

    list nlist = new list();
    Scanner menu_input = null;
    [..] //a couple println here...
    opt = menu_input.nextInt(); //the error points to this line

                switch (opt) { ... }
</code></pre>

<p>why would it cause an error like this?
I'm sorry if this is trivial, but this is my first real experience with Java.</p>

<p>Full text of the error in case it's useful:</p>

<pre><code>Exception in thread "main" java.lang.NullPointerException
    at lab.newJava.main(newJava.java:75)
</code></pre>
