Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

Everything has an expiration date

026 - Java 논리 연산자 (&&, ||, !) 본문

[Java]/Program source (java)

026 - Java 논리 연산자 (&&, ||, !)

Jelly-fish 2023. 8. 28. 16:40
/*=========================================
	■■■ 연산자(Operator) ■■■
	- 논리 연산자
===========================================*/



public class Test026
{
	public static void main(String[] args)
	{
		boolean a = true, b = false;

		System.out.printf("a && b : %b\n", (a && b));
		System.out.printf("a || b : %b\n", (a || b));
		System.out.printf("!a     : %b\n", !a);
		System.out.printf("!b     : %b\n", !b);
	}
}


// 실행 결과

/*
a && b : false
a || b : true
!a     : false
!b     : true
계속하려면 아무 키나 누르십시오 . . .
*/