import java.util.Scanner;
public class teststuff {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
String test;
test = scan.next();
if(test == "example"){
System.out.println("it worked");
}
}
}
Here's the code, and my input is "example" even though it's exactly the same it still doesn't give me a boolean true for my if statement. Is there something I'm doing wrong?