Skip to content

Instantly share code, notes, and snippets.

@rawaludin
Created October 8, 2012 04:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rawaludin/3850742 to your computer and use it in GitHub Desktop.
Save rawaludin/3850742 to your computer and use it in GitHub Desktop.
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