I bet this will be an easy diagnosis but I can't seem to find why I am getting a NullPointerException. I used to make things like this all the time so it's extra weird. Any help will be appreciated.
import java.util.Scanner; public class Main { private static Scanner input = new Scanner(System.in); private static String cmd; public static void main(String[] args){ while(true/*!cmd.equals("quit")*/){ cmd.equals(input.nextLine()); processCommand(); } } //processes commands. Just testing right here ATM public static void processCommand(){ if(cmd.equals("hi")){ System.out.println("boo"); } }