Hi there so i am new to java and am learning it, so i put together this little script, so i was wondering why it dosent work:
public class Main {
    public static void main(String[] args) {
        String text;
        try (Scanner input = new Scanner(System.in)) {
            System.out.println("Input");
            text = input.nextLine();
            while (text == "sampleText") {
                System.out.println("outputText");
            }
        }
        System.out.println("Your input " + text);
    }
}
 
    