Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Belajar AND dan OR di Java
class BelajarVariable
{
public static void main(String[] args) {
int username = 1;
int password = 45;
if (username>=10 || password<=10) {
System.out.println("Anda berhasil login");
if (username>=10) {
System.out.println("Username benar!");
}
if (password<=10) {
System.out.println("Password benar!");
}
} else {
System.out.print("Username dan password tidak cocok!");
if (username>=10) {
System.out.println("Username benar!");
}
if (password<=10) {
System.out.println("Password benar!");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.