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:
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) { ... }
why would it cause an error like this? I'm sorry if this is trivial, but this is my first real experience with Java.
Full text of the error in case it's useful:
Exception in thread "main" java.lang.NullPointerException
at lab.newJava.main(newJava.java:75)