public class OpratorLogika {
public static void main (String []args){
boolean B=true;
boolean S=false;
System.out.println ("Operator OR");
System.out.println ("Benar || Benar : "+(B || B));
System.out.println ("Benar || Salah : "+(B || S));
System.out.println ("Salah || Benar : "+(S || B));
System.out.println ("Salah || Salah : "+(S || S));
System.out.println ("Operator AND");
System.out.println ("Benar && Benar : "+(B && B));
System.out.println ("Benar && Salah : "+(B && S));
System.out.println ("Salah && Benar : "+(S && B));
System.out.println ("Salah && Salah : "+(S && S));
System.out.println ("Operator NOT");
System.out.println ("Tidak Benar : "+!B);
System.out.println ("Tidak Salah : "+!S);
}
}
public static void main (String []args){
boolean B=true;
boolean S=false;
System.out.println ("Operator OR");
System.out.println ("Benar || Benar : "+(B || B));
System.out.println ("Benar || Salah : "+(B || S));
System.out.println ("Salah || Benar : "+(S || B));
System.out.println ("Salah || Salah : "+(S || S));
System.out.println ("Operator AND");
System.out.println ("Benar && Benar : "+(B && B));
System.out.println ("Benar && Salah : "+(B && S));
System.out.println ("Salah && Benar : "+(S && B));
System.out.println ("Salah && Salah : "+(S && S));
System.out.println ("Operator NOT");
System.out.println ("Tidak Benar : "+!B);
System.out.println ("Tidak Salah : "+!S);
}
}
0 comments