I'm new to Java, but I really like learning it and all :).
But, I was trying to make an working calculator, so I wrote this code:
That was my code. Everything works untill I come to the last part, where it should give the answer. This is what I get:Code:import java.util.Scanner;
public class Calculator {
public static void main(String lol[]){
System.out.println("Add the first digit");
Scanner InsertDigit1 = new Scanner(System.in);
double digit1 = InsertDigit1.nextInt();
System.out.println("Plus(+) ,min() ,multiply(*) or divide(/)?");
Scanner InsertMath = new Scanner(System.in);
String Math = InsertMath.nextLine();
System.out.println("Add the second digit");
Scanner InsertDigit2 = new Scanner(System.in);
double digit2 = InsertDigit2.nextInt();
//  means "or", right?
if (Math == "+"  Math == "Plus")
{
double Awnser = (digit1 + digit2);
System.out.println(Awnser);
}
else if (Math == ""  Math == "Min")
{
double Awnser = (digit1  digit2);
System.out.println(Awnser);
}
else if (Math == "*"  Math == "Multiply")
{
double Awnser = (digit1 * digit2);
System.out.println(Awnser);
}
else if (Math == "/"  Math == "Divide")
{
double Awnser = (digit1 / digit2);
System.out.println(Awnser);
}
}
}
It doesn't give any error or something, but it just doesn't print the answer. Anyone knows what I did wrong?Code:Add the first digit
3
Plus(+) ,min() ,multiply(*) or divide(/)?

Add the second digit
1
Also, feel free to post any other java tips if you have them :).