개발자노트

비교연산자와 논리연산자

hansummer 2022. 6. 8. 22:11
package class01;

 

public class Test02 {

 

public static void main(String[] args) {

// 주석 -> 가독성 => "유지보수"

// 변수 3요소

// :공간 / 자료형 / 공간의 이름(식별자)

// :아스키코드, 형변환(자동형변환,명시적형변환)

// 연산자 -> 우선순위 => "디버깅표"

 

// 비교 연산자 (질문)

// "같다." ==

// "같지않다." not -> !=

boolean res=10>=10;

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

System.out.println(11<=11);

System.out.println(res);

System.out.println(10==10);

System.out.println(10!=11);

 

// 논리 연산자

// and ~~이고,~~이면서 동시에,~~하고 &&

// or ~~이거나,혹은,또는 || 쉬프트\

// not 부정 ! 

 

System.out.println(15<=17 && 5<50);

}

}