A byte can hold values of -128 to 127. So when you try to set the value of tiny to 130 -- instead of giving you an overflow error like some other languages, the value actually wraps around to the negative side and you end up with -126. When I try to print the value of character it is not printing anything... So, you're trying to print the character whose value is 32.... well --- if you look up the character 32 in the ASCII table you'll see that 32 is a space!! so -- when you print it -- it looks like nothing -- but its really there. [ February 08, 2003: Message edited by: Jessica Sant ]
130 is beyond the range of byte values (max is 127), casting such value to byte will give such result. 130 = 0000 0000 0000 0000 0000 0000 (1000 0010) after casting to byte, take right most 8 bits: 1000 0010 = -126
value of char (32 = 0x20) is the space character.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop