머리 아픈 비트 문제

headache 1) byte b = 10; System.out.println(~b); // -11 why???? headache 2) int x = 2; System.out.println( 1 + x << 33); // 6 why?? headache 3) % 연산자 10 % 8 -> 2 okay~ 10 % -8 > 2 why? -10 % 8 -> -2 why? -10 % -8 -> -2 why? 이것에 대해서 아시는 분은 정보 좀 부탁드립니다.~ 참고할 것 int x = 3; int y = 5; System.out.println(“x는 ” + x + “이고, y는 ” + y +”일 때, “); System.out.println(“x | y = ” + (x|y)); System.out.println(“x & y = ” + (x&y)); System.out.println(“x ^ y = ” + (x^y)); System.out.println(“true | false = ” + (true|false)); System.out.println(“true & false = ” + (true&false)); System.out.println(“true ^ false…

test

————–Boundary-00=_QTTLULUXFQQMYJ0CCJD0 Content-Type: Text/Plain; charset=”euc-kr” Content-Transfer-Encoding: base64 IG1tbSA= ————–Boundary-00=_QTTLULUXFQQMYJ0CCJD0 Content-Type: Text/HTML; charset=”euc-kr” Content-Transfer-Encoding: base64 PGh0bWw+PGhlYWQ+PHN0eWxlPlAge21hcmdpbi10b3A6MnB4O21hcmdpbi1ib3R0b206MnB4O308 L3N0eWxlPjwvaGVhZD48Ym9keT48dGFibGUgd2lkdGg9NjAwIGJvcmRlcj0wIGNlbGxwYWRkaW5n PTAgY2VsbHNwYWNpbmc9MD4NCjx0cj48dGQgdmFsaWduPXRvcD48b2JqZWN0IGNsYXNzaWQ9ImNs c2lkOkQyN0NEQjZFLUFFNkQtMTFjZi05NkI4LTQ0NDU1MzU0MDAwMCIgY29kZWJhc2U9Imh0dHA6 Ly9kb3dubG9hZC5tYWNyb21lZGlhLmNvbS9wdWIvc2hvY2t3YXZlL2NhYnMvZmxhc2gvc3dmbGFz aC5jYWIjdmVyc2lvbj02LDAsMjksMCIgd2lkdGg9IjYwMCIgaGVpZ2h0PSIzMjAiPjxwYXJhbSBu YW1lPSJtb3ZpZSIgdmFsdWU9Imh0dHA6Ly9zdGF0aWMubmF2ZXIuY29tL25ld19tYWlsL2ZsYXNo LzIwMDYvanVseS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