>>> 无符号右移,<< 左移 >> 右移
org.openjdk.jol
jol-core
0.16
public class OperatorTest {
public static void main(String[] args) {
System.out.println(Integer.toBinaryString(-8));//11111000 100010000
System.out.println(Integer.toBinaryString(-8<<2));
System.out.println(Integer.toBinaryString(-64));
System.out.println(Integer.toBinaryString(-64>>>2));
System.out.println(ClassLayout.parseInstance(10)); // 8 + 4 + 4 = 15
System.out.println(ClassLayout.parseInstance(10l)); // 8 + 4 + 8 + 4 =24
System.out.println(ClassLayout.parseInstance(false)); // 8 + 4 + 1 + 5 = 16
String s = new String("中");
System.out.println(ClassLayout.parseInstance(s));
System.out.println(ClassLayout.parseInstance("中"));
System.out.print(ClassLayout.parseInstance(new Person(20,"zhangsan")));
11111111111111111111111111111000
11111111111111111111111111100000
11111111111111111111111111000000
111111111111111111111111110000
java.lang.Integer.value @12 (int, 4b)
java.lang.Long.value @16 (long, 8b)
java.lang.Boolean.value @12 (boolean, 1b)
java.lang.String.value @12 (byte[], 4b)
java.lang.String.hash @16 (int, 4b)
java.lang.String.coder @20 (byte, 1b)
java.lang.String.value @12 (byte[], 4b)
java.lang.String.hash @16 (int, 4b)
java.lang.String.coder @20 (byte, 1b)
com.example.demo.OperatorTest.Person.age @12 (java.lang.Integer, 4b)
com.example.demo.OperatorTest.Person.name @16 (java.lang.String, 4b)
Process finished with exit code 0