
관계 연산자: ==, !=, >, <
논리 연산자: &&, ||
package ex02; public class CompOperator { public static void main(String[] args) { // " "은 한 칸 띄우려고 썼음 System.out.print((3 == 4)+ " "); // false System.out.print((3 != 4)+ " "); // true System.out.print((3 > 4)+ " "); // false System.out.print((4 > 3)+ " "); // true System.out.println((3 == 3 && 4 == 7) + " "); // false System.out.println((3 == 3 || 4 == 7) + " "); // true } }
Share article