본문 바로가기

카테고리 없음

[생활코딩] 제어문 - 비교연산자

https://opentutorials.org/course/3975/26777

 

비교연산자 - 생활코딩

수업소개 Boolean 데이터 타입이 생성되는 연산자는 비교 연산자입니다. 비교 연산자를 통해서 무엇인가를 비교하는 방법을 살펴보겠습니다. 프로그래밍이 지능적으로 동작하는 핵심은 비교입니

opentutorials.org

 

1 + 1 = 2

 

"1" + "1" "11"

 

boolean간의 연산을하는 연산자를 배우겠다.

 

public class ComparisonOperatorApp {

 

public static void main(String[] args) {

 

System.out.println(1 > 1); // false

System.out.println(1 == 1); // true

System.out.println(1 < 1);

System.out.println(1 >= 1);

 

}

 

}