import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String password = input.nextLine();
if(password == "s3cr3t!P@ssw0rd"){
System.out.println("Welcome");
} else {
System.out.println("Wrong password!");
}
}
}
Ако въведа грешна парола ми изписва Wrong password!, но ако въведа вярната отново ми изписва Wrong password!, а трябва да е Welcome?

Меню