[JAVA] ch03-22. 쉬프트 연산자
·
JAVA/예제
public class Ex22 { // 쉬프트 연산자 public static void main(String[] args){ int temp; System.out.println(-8); System.out.println(Integer.toBinaryString(-8)); System.out.println(); temp = -8 1; // -8/2 System.out.println("-8 >> 1 = " + temp); System.out.println(Integer.toBinaryString(temp)); System.out.println(); temp = -8 >> 2; // -8/4 System.out.println("-8 >> 2 = " + temp); System.out.println(Integ..