Contents
결과 %% (and) = 둘 다 참이여야 참
|| (or) = 하나라도 참이면 참
! (not) = 그냥 거짓
public class Logical2 {
public static void main(String[] args) {
// %%(and), ||(or) !(not)
boolean a = true;
boolean b = false;
System.out.println(a && b); // false
System.out.println(a || b); // true
System.out.println(a && !b); // true
}
}
결과

Share article