I need help with this console game
I'm trying to make a console game in java that tells what your number is It keeps saying your number is 0 at the end and it is not setting variables to any value other than 0 Here it is: import java.util.Scanner; class Program { public static void main(String[] args) { int a; int b; int c; int d; int e; int number; String answer; System.out.println("Pick a number from 1-31\n"); System.out.println("Is your number one of these? 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31"); Scanner a1 = new Scanner(System.in); answer = a1.next(); if(answer == "yes") { a = 1; } else { a = 0; } System.out.println("Is your number one of these? 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31"); Scanner a2 = new Scanner(System.in); answer = a2.next(); if(answer == "yes") { b = 2; } else { b = 0; } System.out.println("Is your number one of these? 4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31"); Scanner a3 = new Scanner(System.in); answer = a3.next(); if(answer == "yes") { c = 4; } else { c = 0; } System.out.println("Is your number one of these? 8, 9, 10, 11, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31"); Scanner a4 = new Scanner(System.in); answer = a4.next(); if(answer == "yes") { d = 8; } else { d = 0; } System.out.println("Is your number one of these? 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31"); Scanner a5 = new Scanner(System.in); answer = a5.next(); if(answer == "yes") { e = 16; } else { e = 0; } number = a + b + c + d + e; System.out.println("Your number is " + (a + b + c + d + e)); } }