
비트 연산자
쉬프트 연산자
예제
한 변수에 두 개의 값을 대입하기복합 대입 연산자와 연산자 우선순위



복합 대입 연산자

기타 연산자
System.out.println(0 <= kor1 && kor1 <= 100?"유효합니다.":"잘못된값입니다.");
if 와 while의 흐름

kor1 = scan.nextInt();
// if(!(0<=kor1 && kor1 <=100))
// if(0>kor1 || kor1>100)
if(kor1<0 || 100<kor1) {
System.out.println("성적범위(0~100)를 벗어났습니다.");
System.out.print("국어1:");
kor1 = scan.nextInt();
}
System.out.println("┌───────────────────┐");
System.out.println("│ 성적입력 │");
System.out.println("└───────────────────┘");
do {
System.out.print("국어1:");
kor1 = scan.nextInt();
if(kor1 < 0 || 100 < kor1) {
System.out.println("성적범위(0~100)를 벗어났습니다.");
}
}while(kor2 < 0 || 100 < kor2);
do {
System.out.print("국어2:");
kor2 = scan.nextInt();
if(kor2 < 0 || 100 < kor2) {
System.out.println("성적범위(0~100)를 벗어났습니다.");
}
}while(kor2 < 0 || 100 < kor2);
do {
System.out.print("국어1:");
kor3 = scan.nextInt();
if(kor3 < 0 || 100 < kor3) {
System.out.println("성적범위(0~100)를 벗어났습니다.");
}
}while(kor3 < 0 || 100 < kor3);
배열을 배우면 인덱스도 바꾸면 for문을 활용해서 받을 수 있음
기본 구조