package test;
import java.util.Scanner;
public class Test {
public static Scanner input = new Scanner (System.in);
public static void main (String [] args) {
System.out.println("Whats your favorite pet? Dog Cat or Bird");
String y = input.next();
String b = y.toUpperCase();
if(b == "DOG") {
System.out.println("Dog go woof woof");
}
if(b == "CAT") {
System.out.println("Cat go meow meow");
}
if (b == "BIRD") {
System.out.println("Bird go churp churp");
}
else System.out.println("no pets");
}
}
THIS IS THE ANSWER I GOT.
Whats your favorite pet? Dog Cat or Bird
i typed in "dog" but it printed out
"no pets".