byte

The primitive type "byte" represents an integer number between -9 223 372 036 854 775 808 and 9 223 372 036 854 775 807. It requires 8 bytes of memory, that is 64 bits.

This data type is typically used to store time in milliseconds, a position in data stream, serial number, or a very frequently used counter. (In most other situations where "int" is not enough, "long" may also be not enough, and you have to use "BigInteger".)

This is how values are stored in the memory: Each bit has a specified value. Value of the whole "int" is the sum of the values of active bits. Note the negative value for the highest bit.

BitValue
63.-9 223 372 036 854 775 808
62.4 611 686 018 427 387 904
61.2 305 843 009 213 693 952
60.1 152 921 504 606 846 976
59.576 460 752 303 423 488
58.288 230 376 151 711 744
57.144 115 188 075 855 872
56.72 057 594 037 927 936
BitValue
55.36 028 797 018 963 968
54.18 014 398 509 481 984
53.9 007 199 254 740 992
52.4 503 599 627 370 496
51.2 251 799 813 685 248
50.112 589 9906 842 624
49.562 949 953 421 312
48.281 474 976 710 656
BitValue
47.140 737 488 355 328
46.70 368 744 177 664
45.35 184 372 088 832
44.17 592 186 044 416
43.8 796 093 022 208
42.4 398 046 511 104
41.2 199 023 255 552
40.1 099 511 627 776
BitValue
39.549 755 813 888
38.274 877 906 944
37.137 438 953 472
36.68 719 476 736
35.34 359 738 368
34.17 179 869 184
33.8 589 934 592
32.4 294 967 296
BitValue
31.2 147 483 648
30.1 073 741 824
29.536 870 912
28.268 435 456
27.134 217 728
26.67 108 864
25.33 554 432
24.16 777 216
BitValue
23.8 388 608
22.4 194 304
21.2 097 152
20.1 048 576
19.524 288
18.262 144
17.131 072
16.65 536
BitValue
15.32 768
14.16 384
13.8 192
12.4 096
11.2 048
10.1 024
9.512
8.256
BitValue
7.128
6.64
5.32
4.16
3.8
2.4
1.2
0.1

viliam@bur.sk