>>>
의 작동 방식을 이해했습니다. 그것을 위해 나는이 프로그램이 있습니다>>> 연산자가 Java에서 작동하는 방식
public class Main {
public static void main(String[] args)
{
short i = 130;
byte b = (byte)i;
String a = Integer.toBinaryString(256 + (int) b);
System.out.println(Integer.toBinaryString(i));
System.out.println(a.substring(a.length() -8));
System.out.println(b);
byte c = (byte) (b >>> 2);
String x = Integer.toBinaryString(256 + (int) c);
System.out.println(x.substring(x.length() -8));
System.out.println(c);
}
}
을 그리고이 출력을 얻을 :
10000010
10000010
-126
11100000
-32
는 바이너리로 표시하려면 어떻게 바이너리 문자열로 바이트를 표시하는 here을 발견했다.
운영자 >>>
는 0을 추가 할 것입니다,하지만 난이 얻을 :의 대신
-126
11100000
-63
을 :
-126
10100000
-32
그것은 1 0 대신 추가된다
11100000
10100000
무엇 오전 내가 잘못하고있어? 아마 나는 아무것도 이해하지 못한다.
@DanielDiPaolo wrong. 또한이 질문에 대한 답변을 마치기 전에 – Woot4Moo
@DanielDiPaolo'>>>'이 0 자릿수 오른쪽 시프트 인 것으로 느껴집니다. – Mysticial