This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hex literals are int. Therefore, your literal 0xff is really 0x000000ff, which is a positive int. When you apply unary "-" operator to that, you get a negative int (0xffffff01, I think). That negative int is not in byte range.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Joined: Jan 10, 2005
Does that mean i can not assign -1 or -2 as hex literals to byte var? I am still not clear bkz it allows other -ve numbers like -121 -128 etc. Can you please elaborate it.