public void setAns() {
        if("TF".equals(queType)){
           ans.add("True");
           ans.add("False");
        }
        else if("MC".equals(queType)){
            System.out.println("Enter choice 1 of 4");
            String ch1 = StdIn.readLine();
            ans.add(ch1);
            System.out.println("Enter choice 2 of 4");
            String ch2 = StdIn.readLine();
            ans.add(ch2);
            System.out.println("Enter choice 3 of 4");
            String ch3 = StdIn.readLine();
            ans.add(ch3);
            System.out.println("Enter choice 4 of 4");
            String ch4 = StdIn.readLine();
            ans.add(ch4);
        }
        else if("L5".equals(queType)){
            ans.add("1");
            ans.add("2");
            ans.add("3");
            ans.add("4");
            ans.add("5");
        }
    }
ans is an Arraylist . I am trying to add the user's input which is String. When i run it it prints the first message but has an error when i enter the value for "ch1". It basically doesn't read it and it prompts me for a null pointer exception
 
     
    