0
How does one do an if statement withuser input?
I'm trying to make a password program, but ai just cant seem to get iy right...
1 Réponse
+ 1
import java.util.Scanner;
class MyClass {
public static void main(String[ ] args) {
Scanner myVar = new Scanner(System.in);
int x= myVar.nextLine();
if(x==1234){
System.out.println("pass is true");
} else{
System.out.println("pass is false");
}
}
}