Kalkulator Java nie wykonuje instrukcji if-duplicate

To pytanie ma już odpowiedź tutaj:

Using scanner.nextLine () [duplikat] 5 odpowiedzi Problem ze skanerem podczas korzystania z nextLine po nextXXX [duplikat]

Jestem stosunkowo nowy w programowaniu i niedawno zacząłem uczyć się Java, aby przejść do programowania na Androida. Myślałem, że stworzę bardzo prosty kalkulator do ćwiczeń, ale wygląda na to, że moje zdanie if nie działa.

import java.util.Scanner;

public class Calculator {

    public static void main(String[] args) {
        //Create new scanner object
        Scanner numInput = new Scanner( System.in );

        //Enter first number
        System.out.println("Please enter the first number: ");
        int num1 = numInput.nextInt();

        //Enter the second number
        System.out.println("Please enter the second number: ");
        int num2 = numInput.nextInt();

        //Choose the operation to perform (+,-,*,/)
        System.out.println("What operation would you like to do?");
        System.out.println("Type \"+\" to add.");
        System.out.println("Type \"-\" to subtract.");
        System.out.println("Type \"*\" to multiply.");
        System.out.println("Type \"/\" to divide.");
        String opChoice = numInput.nextLine();


        //Add
        if (opChoice.equals("+")) {
            int ans = num1 + num2;
            System.out.println("Adding " + num2 + " to " + num1 + " equals " + ans + ".");
        }

        //Subtract
        else if (opChoice.equals("-")) {
            int ans = num1 - num2;
            System.out.println("Subtracting " + num2 + " from " + num1 + " equals " + ans + ".");
        }

        //Multiply
        else if (opChoice.equals("*")) {
            int ans = num1 + num2;
            System.out.println("Multiplying " + num2 + " with " + num1 + " equals " + ans + ".");
        }

        //Divide
        else if (opChoice.equals("/")) {
            int ans = num1 + num2;
            System.out.println("Dividing " + num1 + " by " + num2 + " equals " + ans + ".");
        }

    }

}

Korzystam z Eclipse IDE i działa dobrze, dopóki nie zapyta, którą operację wykonać. Wyświetli opcje, ale nie pozwoli mi nic wprowadzić (testowałem to, mnożąc 5 przez 2).

Szukałem podobnych pytań i próbowałem ich sugestii, ale nadal nie działa. Byłbym wdzięczny za wszelką pomoc, zakładam, że to prawdopodobnie tylko prosty błąd, który popełniam, więc przepraszam, jeśli wydaje się to głupie pytanie!

EDIT: Dzięki za szybkie odpowiedzi! Doceniam to. I tak, naprawiłem mnożenie i dzielenie. :)

questionAnswers(3)

yourAnswerToTheQuestion