So.. I have this code.. And for some reason it says "No Output" I wanted to make a code, where if I put in input .. Let's say "a" it will bring a math formula.. If I print "b" it will bring another math formula.. Please.. Need some help
The code:
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
String[][] dictionary = {{"a", "asociat lui a"}, {"b", "asociat lui b"}, {"c", "asociat lui c"}, {"d", "asociat lui d"}, {"e", "asociat lui e"}};
Scanner XD=new Scanner(System.in);
String x=new String();
x=XD.next();
if(x=="a"){
System.out.println(dictionary[0][1]);
}
else if(x=="b"){
System.out.println(dictionary[1][1]);
}
else if(x=="c"){
System.out.println(dictionary[2][1]);
}
else if(x == "d"){
System.out.println(dictionary[3][1]);
}
else if(x == "e"){
System.out.println(dictionary[4][1]);
}
}
}