I am very new in java and to programming overall. Recently, I have started an IA mock-up program, but my else-if
part of code is not showing in the terminal, I suppose. However, the if
and the else
statements do seem to work perfectly.
I'd appreciate any help you can provide.
Sorry for my lackluster English and my inaccurate words.
import java.util.Scanner;
public class IA
{
public static void main(String []args){
Scanner lector= new Scanner(System.in);
System.out.println("Di algo");
String input = lector.next();
if (input.equals ("Hola") || input.equals("hola") || input.equals("ola")){
System.out.println("Hola, humano");
}else if (input==("quien eres")){
System.out.println("Una pobre ilusión de inteligencia artificial");
}else{
System.out.println("Adiós");
}
}
}