How do I make the IF statement check secondExample?
The question asks to use an if statement to check if the firstExample is equal to secondExample. So I tried if(firstExample == secondExample) , consoleprintf("the first is equal to the second") but it says its wrong... what did I do wrong?
// I have imported a java.io.Console for you, it is named console. String firstExample = "hello"; if(firstExample.equals("hello")); console.printf("first is equal to second"); String secondExample = "hello"; String thirdExample = "HELLO";
Steven Parker203,717 Points
Just put "secondExample" in the test method instead of duplicating the literal string. Also move the new code down after the variables are initialized.