Here's the code:
import java.util.Scanner;
public class Hallo {
public static void main(String[] args) {
System.out.println("What is your name?");
Scanner firstScanner = new Scanner(System.in);
String imput = firstScanner.nextLine();
if (imput.length() > 6 ) {
System.out.println("That's quite a long name!");
}
else {
System.out.println("A nice and consise name you have.");
}
imput = firstScanner.nextLine();
if (imput == "Thank you") {
System.out.println("Yes, so how many siblings do you have?");
}
else {
System.out.print("Aren't you suppose to say 'Thank you' when someone complements you?");
}
}
}
When I type, "Thank you" in the console, it still says "Aren't you suppose to say 'Thank you' when someone complements you?" even though I typed it exactly as I declared it. Why won't it ask me how many siblings I have?
Sorry if that was hard to understand.